The list of modules * FALSE on error * =========================================================*/ public static function getAll(){ return Table::get('module')->select('*')->fetch(); } /* [2] Fetch all modules for the given warehouse * * @id_warehouse UID of the given warehouse * * @return modules The list of modules * FALSE on error * =========================================================*/ public static function getForWarehouse($id_warehouse){ /* (1) Build request */ $modules = Table::get('module')->select('*'); $merge = Table::get('module_availability')->whereIdWarehouse($id_warehouse); $merge->join('id_module', $modules); return $merge->fetch(); } /* [3] Fetch all modules for the given machine_cluster * * @id_warehouse UID of the given warehouse * @id_machine_cluster UID of the given machine_cluster * * @return modules The list of modules * FALSE on error * =========================================================*/ public static function getForMachineCluster($id_warehouse, $id_machine_cluster){ /* (1) On récupère le ETREE de la machine ---------------------------------------------------------*/ $module = Table::get('module') ->select('id_module') ->select('name'); $etree = Table::get('etree') ->join('id_module', $module); $merge = Table::get('module_merge') ->join('id_etree', $etree) ->whereIdWarehouse($id_warehouse) ->whereIdMachineCluster($id_machine_cluster); return $merge->fetch(); } } ?>