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