Example #1
0
 public function getDevice($device_id)
 {
     if (empty($this->_devices[$device_id])) {
         $device = new Application_Model_Device();
         $device->find(array("app_id" => $this->getId(), "type_id" => $device_id));
         if (!$device->getId()) {
             $device->loadDefault($device_id);
             $device->setAppId($this->getId());
         }
         $this->_devices[$device_id] = $device;
     }
     return $this->_devices[$device_id];
 }