|
@@ -0,0 +1,46 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace StatsBundle\Controller;
|
|
|
+
|
|
|
+use Base\AdminBundle\Controller\CRUDController;
|
|
|
+use Symfony\Component\HttpFoundation\Response;
|
|
|
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
|
+use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
|
|
+
|
|
|
+class CablemodemCRUDController extends CRUDController
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Show action.
|
|
|
+ *
|
|
|
+ * @param int|string|null $id
|
|
|
+ *
|
|
|
+ * @return Response
|
|
|
+ *
|
|
|
+ * @throws NotFoundHttpException If the object does not exist
|
|
|
+ * @throws AccessDeniedException If access is not granted
|
|
|
+ */
|
|
|
+ public function showAction($id = null)
|
|
|
+ {
|
|
|
+ $request = $this->getRequest();
|
|
|
+ $id = $request->get($this->admin->getIdParameter());
|
|
|
+
|
|
|
+ $object = $this->admin->getRepository('StatsBundle:Cablemodem')->findByCustomId($id);
|
|
|
+
|
|
|
+ $this->admin->checkAccess('show', $object);
|
|
|
+
|
|
|
+ $preResponse = $this->preShow($request, $object);
|
|
|
+ if ($preResponse !== null) {
|
|
|
+ return $preResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->admin->setSubject($object);
|
|
|
+
|
|
|
+ return $this->render($this->admin->getTemplate('show'), array(
|
|
|
+ 'action' => 'show',
|
|
|
+ 'object' => $object,
|
|
|
+ 'elements' => $this->admin->getShow(),
|
|
|
+ ), null);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|