Error

Undefined class constant 'YEAR'

/var/www/html/framework/db/ar/CActiveRecord.php(145)

133      */
134     public function __get($name)
135     {
136         if(isset($this->_attributes[$name]))
137             return $this->_attributes[$name];
138         elseif(isset($this->getMetaData()->columns[$name]))
139             return null;
140         elseif(isset($this->_related[$name]))
141             return $this->_related[$name];
142         elseif(isset($this->getMetaData()->relations[$name]))
143             return $this->getRelated($name);
144         else
145             return parent::__get($name);
146     }
147 
148     /**
149      * PHP setter magic method.
150      * This method is overridden so that AR attributes can be accessed like properties.
151      * @param string $name property name
152      * @param mixed $value property value
153      */
154     public function __set($name,$value)
155     {
156         if($this->setAttribute($name,$value)===false)
157         {

Stack Trace

#0
+
 /var/www/html/protected/models/CompareItem.php(113): CompareItem->getClientStringCookie()
108         return request()->cookies['client'];
109     }
110     
111     public function getItems() {
112         if (empty($this->_items)) {
113             $this->_items = self::model()->with('item:withDeleted')->findAllByAttributes(array('clientString' => $this->getClientStringCookie()->value));
114         }
115 
116         return $this->_items;
117     }
118     public static function item($itemId) {
#3
+
 /var/www/html/protected/models/CompareItem.php(136): CActiveRecord->__get("items")
131        return  $string; 
132     }
133     public static function countNumberCompare(){
134         $model =new CompareItem;
135         $count='0';
136         if (count($model->items)){
137             $count=count($model->items);
138         }
139        return  $count; 
140     }    
141     
#4
+
 /var/www/html/themes/vashdom/views/catalog/category.php(183): CompareItem::countNumberCompare()
178               </div>
179             </div>
180 
181 <?php /**/ ?>
182 <div class="compare-list">
183         <span  class="compare-null" style="display:<?=(CompareItem::countNumberCompare()==0)?'blok':'none';?>"> </span>
184         <a class="compare-not-null" href='<?=createUrl('compare/index');?>' style="display:<?=(CompareItem::countNumberCompare()!=0)?'blok':'none';?>">
185             <span> сравнить</span>
186             <span class="compare-count"><?=CompareItem::countCompare();?></span>
187             <span class="clear-compare-list" href="#" title="Очистить список сравнения">&nbsp;&nbsp;&nbsp;&nbsp;</span>
188         </a>
2024-03-19 02:25:28 Apache/2.4.25 (Debian) Yii Framework/1.1.15