protected function findModel($id) { if (($model = ProductsImages::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function getImages() { $this->_images = ProductsImages::findAll(['product_id' => $this->id]); return $this->_images; }