12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
-
- namespace App\Http\Controller;
-
- use App\Http\Business\CameraTypesBusiness;
- use Luticate\Utils\LuController;
- use App\Http\Business\CamerasBusiness;
- use App\Http\DBO\CamerasDbo;
- use Luticate\Utils\LuMultipleDbo;
-
- class CamerasController extends LuController {
- protected function getBusiness()
- {
- return new CamerasBusiness();
- }
-
- /**
- * Get all camera types
- * @param int $page The page number, 0 based
- * @param int $perPage The number of items per page
- * @param string $query The filter query
- * @return LuMultipleDbo
- */
- public function getAllTypes($page = 0, $perPage = PHP_INT_MAX, $query = "")
- {
- return CameraTypesBusiness::getAll($page, $perPage, $query);
- }
-
- /**
- * Get all cameras, sorted by name
- * @param int $page The page number, 0 based
- * @param int $perPage The number of items per page
- * @param string $query The filter query
- * @return \Luticate\Utils\LuMultipleDbo
- */
- public function getAll($page = 0, $perPage = PHP_INT_MAX, $query = "")
- {
- return CamerasBusiness::getAll($page, $perPage, $query);
- }
-
- /**
- * Get a camera
- * @param $camera_id int The camera id
- * @return CamerasDbo
- */
- public function get($camera_id)
- {
- return CamerasBusiness::getById($camera_id);
- }
-
- /**
- * Add a new camera
- * @param CamerasDbo $camera The camera
- * @return int
- */
- public function add(CamerasDbo $camera)
- {
- return CamerasBusiness::add($camera);
- }
-
- /**
- * Edit an existing camera
- * @param CamerasDbo $camera The camera
- * @param $camera_id int The camera id
- * @return bool
- */
- public function edit(CamerasDbo $camera, $camera_id)
- {
- return CamerasBusiness::edit($camera, $camera_id);
- }
-
- /**
- * Delete an existing camera
- * @param $camera_id int The camera id
- * @return bool
- */
- public function del($camera_id)
- {
- return CamerasBusiness::deleteById($camera_id);
- }
-
- /**
- * Get an image from the camera
- * @param $camera_id int The camera id
- * @return mixed
- */
- public function getImage($camera_id)
- {
- return CamerasBusiness::getImage($camera_id);
- }
- }
|