/** {@inheritdoc} */ public function afterPerform() { if ($this->collection->count() === 0) { throw new NotFoundHttpException('Object not found'); } parent::afterPerform(); }