Exemplo n.º 1
0
 public function getItem()
 {
     parent::getItem();
     if (!isset($this->item)) {
         $id = $this->getState('driver.id');
         $query = $this->_db->getQuery(true)->from('#__fleet_driver as h')->leftJoin('#__fleet_entity as c ON h.entity_id=c.id')->select('h.*, c.name as entity')->where('h.id=' . (int) $id);
         $this->_db->setQuery($query);
         if (!($this->item = $this->_db->loadObject())) {
             $this->setError($this->_db->getErrorMsg());
         }
     }
     return $this->item;
 }
Exemplo n.º 2
0
 public function getItem()
 {
     parent::getItem();
     if (!isset($this->item) || FALSE === $this->item) {
         $id = $this->getState('map.id');
         $this->_db->setQuery($this->_db->getQuery(true)->from('fleet_trip as h')->select('h.*')->where('h.id=' . (int) $id));
         if (!($this->item = $this->_db->loadObject())) {
             $this->setError($this->_db->getErrorMsg());
         } else {
             // success
         }
     }
     return $this->item;
 }
Exemplo n.º 3
0
 public function getItem()
 {
     parent::getItem();
     if (!isset($this->item)) {
         $id = $this->getState('user.id');
         $this->_db->setQuery($this->_db->getQuery(true)->from('#__fleet_user as h')->leftJoin('#__users as a ON h.id=a.id')->leftJoin('#__fleet_entity as c ON h.entity_id=c.id')->select('h.*, a.username, a.name, a.email')->where('h.id=' . (int) $id));
         if (!($this->item = $this->_db->loadObject())) {
             $this->setError($this->_db->getErrorMsg());
         } else {
             // success
         }
     }
     return $this->item;
 }
Exemplo n.º 4
0
 public function getItem()
 {
     parent::getItem();
     if (!isset($this->item)) {
         $clause = "h.*, a.name as entity, a.id as entity_id, b.name as driver, b.id as driver_id," . "c.id as weight_id, CONCAT(c.min, '-', c.max) as weight";
         $id = $this->getState('subscription.id');
         $query = $this->_db->getQuery(true)->from('#__fleet_subscription as h')->leftJoin('#__fleet_entity as a ON h.entity_id=a.id')->leftJoin('#__fleet_driver as b ON h.driver_id=b.id')->leftJoin('#__fleet_weight as c ON h.weight_id=c.id')->select($clause)->where('h.id=' . (int) $id);
         $this->_db->setQuery($query);
         if (!($this->item = $this->_db->loadObject())) {
             $this->setError($this->_db->getErrorMsg());
         }
     }
     return $this->item;
 }
Exemplo n.º 5
0
 public function getItem()
 {
     parent::getItem();
     if (!isset($this->item) || FALSE === $this->item) {
         $id = $this->getState('entity.id');
         $this->_db->setQuery($this->_db->getQuery(true)->from('#__fleet_entity as h')->leftJoin('#__fleet_entity as c ON h.parent_entity_id=c.id')->select('h.*, c.name as parent_entity')->where('h.id=' . (int) $id));
         if (!($this->item = $this->_db->loadObject())) {
             $this->setError($this->_db->getErrorMsg());
         } else {
             // success
         }
     }
     return $this->item;
 }
Exemplo n.º 6
0
 public function getItem()
 {
     parent::getItem();
     return $this;
 }