Example #1
0
 /**
  * @param $roomId int
  * @return \Application\EmpItem|bool
  */
 public function getById($roomId, \Core\Database $db)
 {
     if ($arr = $db->fetchFirstAssoc("select * from rooms where id=:id", array(":id" => $roomId))) {
         return new \Application\RoomItem($arr);
     } else {
         return false;
     }
 }
Example #2
0
 public function getByLogin($login, \Core\Database $db)
 {
     if ($arr = $db->fetchFirstAssoc("select * from employees where login=:login", array(":login" => $login))) {
         return new \Application\EmpItem($arr);
     } else {
         return false;
     }
 }
Example #3
0
 public function getMaxChainId(\Core\Database $db)
 {
     $sql = "select max(chain) from appointments";
     $res = $db->fetchFirstAssoc($sql, array());
     if ($res) {
         return $res['max(chain)'];
     } else {
         return false;
     }
 }