12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
-
- namespace App\Http\Controller;
-
- use Luticate\Utils\LuController;
- use App\Http\Business\HostsBusiness;
- use App\Http\DBO\HostsDbo;
-
- class HostsController extends LuController {
- protected function getBusiness()
- {
- return new HostsBusiness();
- }
-
- /**
- * Get all hosts, 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 HostsBusiness::getAll($page, $perPage, $query);
- }
-
- /**
- * Get a host
- * @param $host_id int The host id
- * @return HostsDbo
- */
- public function get($host_id)
- {
- return HostsBusiness::getById($host_id);
- }
-
- /**
- * Add a new host
- * @param HostsDbo $host The host
- * @return int
- */
- public function add(HostsDbo $host)
- {
- return HostsBusiness::add($host);
- }
-
- /**
- * Edit an existing host
- * @param HostsDbo $host The host
- * @param $host_id int The host id
- * @return bool
- */
- public function edit(HostsDbo $host, $host_id)
- {
- return HostsBusiness::edit($host, $host_id);
- }
-
- /**
- * Delete an existing host
- * @param $host_id int The host id
- * @return bool
- */
- public function del($host_id)
- {
- return HostsBusiness::deleteById($host_id);
- }
- }
|