1: <?php defined('_JOOS_CORE') or exit();
2:
3: /**
4: * Модель сайта компонента ведения блогов, записи блогов
5: *
6: * @version 1.0
7: * @package Components\Blogs
8: * @subpackage Models\Site
9: * @author Joostina Team <info@joostina.ru>
10: * @copyright (C) 2007-2012 Joostina Team
11: * @license MIT License http://www.opensource.org/licenses/mit-license.php
12: * Информация об авторах и лицензиях стороннего кода в составе Joostina CMS: docs/copyrights
13: *
14: * */
15: class modelBlogs extends joosModel
16: {
17: /**
18: * @field int(11) unsigned
19: * @type int
20: */
21: public $id;
22: /**
23: * @field varchar(255)
24: * @type string
25: */
26: public $title;
27: /**
28: * @field varchar(255)
29: * @type string
30: */
31: public $slug;
32: /**
33: * @field text
34: * @type string
35: */
36: public $text_intro;
37: /**
38: * @field longtext
39: * @type string
40: */
41: public $text_full;
42: /**
43: * @field text
44: * @type string
45: */
46: public $params;
47: /**
48: * @field tinyint(2) unsigned
49: * @type int
50: */
51: public $category_id;
52: /**
53: * @field int(11) unsigned
54: * @type int
55: */
56: public $user_id;
57: /**
58: * @field tinyint(1) unsigned
59: * @type int
60: */
61: public $state;
62: /**
63: * @field datetime
64: * @type datetime
65: */
66: public $created_at;
67: /**
68: * @field datetime
69: * @type datetime
70: */
71: public $modified_at;
72:
73: /*
74: * Constructor
75: *
76: */
77: public function __construct()
78: {
79: parent::__construct( '#__blogs', 'id' );
80: }
81:
82: public function check()
83: {
84: $this->filter();
85:
86: return true;
87: }
88:
89: public function before_insert()
90: {
91: return true;
92: }
93:
94: public function after_insert()
95: {
96: return true;
97: }
98:
99: public function before_update()
100: {
101: return true;
102: }
103:
104: public function after_update()
105: {
106: return true;
107: }
108:
109: public function before_store()
110: {
111: return true;
112: }
113:
114: public function after_store()
115: {
116: return true;
117: }
118:
119: public function before_delete()
120: {
121: return true;
122: }
123:
124: }
125:
126: /**
127: * Модель сайта компонента ведения блогов, категории блогов
128: *
129: * @package Components\BlogCategory
130: * @subpackage Models\Site
131: * @author JoostinaTeam
132: * @copyright (C) 2007-2012 Joostina Team
133: * @license MIT License http://www.opensource.org/licenses/mit-license.php
134: * @created 2012-04-22 18:26:20
135: * Информация об авторах и лицензиях стороннего кода в составе Joostina CMS: docs/copyrights
136: *
137: */
138: class modelBlogsCategory extends joosModel
139: {
140: /**
141: * @field int(10) unsigned
142: * @type int
143: */
144: public $id;
145: /**
146: * @field varchar(200)
147: * @type string
148: */
149: public $title;
150: /**
151: * @field varchar(100)
152: * @type string
153: */
154: public $slug;
155: /**
156: * @field text
157: * @type string
158: */
159: public $description;
160: /**
161: * @field text
162: * @type string
163: */
164: public $params;
165: /**
166: * @field tinyint(1) unsigned
167: * @type int
168: */
169: public $state;
170: /**
171: * @field datetime
172: * @type datetime
173: */
174: public $created_at;
175:
176: /*
177: * Constructor
178: *
179: */
180: public function __construct()
181: {
182: parent::__construct( '#__blogs_category', 'id' );
183: }
184:
185: public function check()
186: {
187: $this->filter();
188:
189: return true;
190: }
191:
192: public function before_insert()
193: {
194: return true;
195: }
196:
197: public function after_insert()
198: {
199: return true;
200: }
201:
202: public function before_update()
203: {
204: return true;
205: }
206:
207: public function after_update()
208: {
209: return true;
210: }
211:
212: public function before_store()
213: {
214: // формирование ссылки на категорию блогов
215: $new_slug = joosRequest::param('slug',false);
216: $this->slug = $new_slug ? $new_slug : joosText::text_to_url($this->title);
217:
218: return true;
219: }
220:
221: public function after_store()
222: {
223: return true;
224: }
225:
226: public function before_delete()
227: {
228: return true;
229: }
230:
231: }
232: