123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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);
- }
- }
|