123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
-
- namespace App\Http\Controller;
-
- use App\Http\Business\CommandTypesBusiness;
- use Luticate\Utils\LuController;
- use App\Http\Business\CommandsBusiness;
- use App\Http\DBO\CommandsDbo;
- use Luticate\Utils\LuMultipleDbo;
-
- class CommandsController extends LuController {
- protected function getBusiness()
- {
- return new CommandsBusiness();
- }
-
- /**
- * Get all command 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 CommandTypesBusiness::getAll($page, $perPage, $query);
- }
-
- /**
- * Get all commands, 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 CommandsBusiness::getAll($page, $perPage, $query);
- }
-
- /**
- * Get a command
- * @param $command_id int The command id
- * @return CommandsDbo
- */
- public function get($command_id)
- {
- return CommandsBusiness::getById($command_id);
- }
-
- /**
- * Add a new command
- * @param CommandsDbo $command The command
- * @return int
- */
- public function add(CommandsDbo $command)
- {
- return CommandsBusiness::add($command);
- }
-
- /**
- * Edit an existing command
- * @param CommandsDbo $command The command
- * @param $command_id int The command id
- * @return bool
- */
- public function edit(CommandsDbo $command, $command_id)
- {
- return CommandsBusiness::edit($command, $command_id);
- }
-
- /**
- * Delete an existing command
- * @param $command_id int The command id
- * @return bool
- */
- public function del($command_id)
- {
- return CommandsBusiness::deleteById($command_id);
- }
- }
|