public function getThumbnails()
 {
     return $this->hasMany(\app\models\UserProfilePicture::className(), ['original_picture_id' => 'id']);
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function removePicture($id = null)
 {
     if ($this->getIsNewRecord()) {
         return 0;
     }
     $attributes = ['user_id' => $this->id];
     if ($id !== null) {
         $attributes['id'] = $id;
     }
     return \app\models\UserProfilePicture::model()->deleteAllByAttributes($attributes);
 }