protected function findModel($id) { if (($model = Thumbnail::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function getThumbnails() { return $this->hasMany(Thumbnail::className(), ['product_id' => 'id'])->limit(3); }