public function getPhotos() { if (!empty($this->_photos)) { return $this->_photos; } $photos = PostImage::find()->where(['post' => $this->id, 'deleted' => 0])->all(); return $this->_photos = $photos; }