1: <?php defined('_JOOS_CORE') or exit();
2:
3: /**
4: * Модель сайта компонента управления новостями
5: *
6: * @version 1.0
7: * @package Components\News
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 modelNews extends joosModel
16: {
17: /**
18: * @field int(11) unsigned
19: * @type int
20: */
21: public $id;
22: /**
23: * @field varchar(200)
24: * @type string
25: */
26: public $title;
27: /**
28: * @field varchar(200)
29: * @type string
30: */
31: public $slug;
32: /**
33: * @field text
34: * @type string
35: */
36: public $introtext;
37: /**
38: * @field longtext
39: * @type string
40: */
41: public $fulltext;
42: /**
43: * @field varchar(255)
44: * @type string
45: */
46: public $image;
47: /**
48: * @field int(11) unsigned
49: * @type int
50: */
51: public $category_id;
52: /**
53: * @field datetime
54: * @type datetime
55: */
56: public $created_at;
57: /**
58: * @field tinyint(1) unsigned
59: * @type int
60: */
61: public $state;
62: /*
63: * Constructor
64: */
65: public function __construct()
66: {
67: parent::__construct( '#__news', 'id' );
68: }
69: public function check()
70: {
71: $this->filter();
72:
73: return true;
74: }
75:
76: public function before_insert()
77: {
78: return true;
79: }
80: public function after_insert()
81: {
82: return true;
83: }
84: public function before_update()
85: {
86: return true;
87: }
88: public function after_update()
89: {
90: return true;
91: }
92: public function before_store()
93: {
94: // формирование ссылки на категорию блогов
95: $new_slug = joosRequest::param('slug',false);
96: $this->slug = $new_slug ? $new_slug : joosText::text_to_url($this->title);
97:
98: return true;
99: }
100: public function after_store()
101: {
102: return true;
103: }
104: public function before_delete()
105: {
106: return true;
107: }
108: }
109:
110: /**
111: * Модель панели управления компонента управления типами новостей
112: *
113: * @version 1.0
114: * @package Components\News
115: * @subpackage Models\Site
116: * @author Joostina Team <info@joostina.ru>
117: * @copyright (C) 2007-2012 Joostina Team
118: * @license MIT License http://www.opensource.org/licenses/mit-license.php
119: * Информация об авторах и лицензиях стороннего кода в составе Joostina CMS: docs/copyrights
120: *
121: * */
122: class modelNewsType extends joosModel
123: {
124: }
125: