/** * Find an attribute or throw a 404 * * @param integer $id The id of the attribute * * @throws NotFoundHttpException * @return AttributeInterface */ protected function findAttributeOr404($id) { try { $result = $this->attributeManager->getAttribute($id); } catch (EntityNotFoundException $e) { throw new NotFoundHttpException($e->getMessage()); } return $result; }