コード例 #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];
 }
コード例 #2
0
 public function delete(Application_Model_Device $model)
 {
     if ($model->getId()) {
         $this->getDbTable()->delete(array('id = ?' => $model->getId()));
     }
 }