Example #1
0
 public function hasImage($type)
 {
     $img = $this->getImage();
     if (!$img) {
         return false;
     }
     $type = $this->getPictureType($type);
     return parent::imageExists($type['path'] . $img);
 }
Example #2
0
 public function attach($component)
 {
     if ($this->imagesRelationName == null) {
         throw new CException('Не указанно имя отношения для модели изображений!');
     }
     $relation = $component->getActiveRelation($this->imagesRelationName);
     if (!$relation instanceof CHasManyRelation) {
         throw new CException('Имя отношения для модели изображений указанно не верно!');
     }
     $this->imgModel = $relation->className;
     $this->foreignKey = $relation->foreignKey;
     return parent::attach($component);
 }