Exemplo n.º 1
0
 protected function _update(Model_DomainObjectAbstract $obj)
 {
     $db = $this->getDb();
     $data = array('name' => $obj->getName(), 'path' => $obj->getPath(), 'users_id' => $obj->getUsersId());
     $where = $db->quoteInto('id = ?', $obj->getId());
     $db->update('catalogs', $data, $where);
 }
 public function save(Model_DomainObjectAbstract $obj)
 {
     if (is_null($obj->getId())) {
         $this->_insert($obj);
     } else {
         $this->_update($obj);
     }
 }
Exemplo n.º 3
0
 protected function _update(Model_DomainObjectAbstract $obj)
 {
     $db = $this->getDb();
     $data = array('catalogs_id' => $obj->getCatalogsId(), 'filename' => $obj->getFilename(), 'filesize' => $obj->getFilesize(), 'mimeType' => $obj->getMimeType(), 'height' => $obj->getHeight(), 'width' => $obj->getWidth(), 'dateTimeOriginal' => $obj->getDateTimeOriginal(), 'make' => $obj->getMake(), 'model' => $obj->getModel(), 'orientation' => $obj->getOrientation(), 'xResolution' => $obj->getXResolution(), 'yResolution' => $obj->getYResolution(), 'exposureTime' => $obj->getExposureTime(), 'exposureProgram' => $obj->getExposureProgram(), 'exposureMode' => $obj->getExposureMode(), 'fNumber' => $obj->getFNumber(), 'focalLength' => $obj->getFocalLength(), 'isoSpeedRatings' => $obj->getIsoSpeedRatings(), 'lightSource' => $obj->getLightSource(), 'whiteBalance' => $obj->getWhiteBalance(), 'flash' => $obj->getFlash(), 'digitalZoomRatio' => $obj->getDigitalZoomRatio(), 'gpsLatitudeRef' => $obj->getGpsLatitudeRef(), 'gpsLatitude' => $obj->getGpsLatitude(), 'gpsLongitudeRef' => $obj->getGpsLongitudeRef(), 'gpsLongitude' => $obj->getGpsLongitude(), 'headline' => $obj->getHeadline(), 'caption' => $obj->getCaption(), 'writer' => $obj->getWriter(), 'copyrightNotice' => $obj->getCopyrightNotice(), 'contact' => $obj->getContact(), 'objectName' => $obj->getObjectName(), 'byLineTitle' => $obj->getByLineTitle(), 'city' => $obj->getCity(), 'subLocation' => $obj->getSubLocation(), 'province' => $obj->getProvince(), 'countryCode' => $obj->getCountryCode(), 'country' => $obj->getCountry(), 'keywords' => $obj->getKeywords());
     $where = $db->quoteInto('id = ?', $obj->getId());
     $db->update('photos', $data, $where);
 }
Exemplo n.º 4
0
 protected function _insert(Model_DomainObjectAbstract $obj)
 {
     $db = $this->getDb();
     $data = array('username' => $obj->getUsername(), 'password' => $obj->getPassword(), 'firstname' => $obj->getFirstname(), 'lastname' => $obj->getLastname(), 'email' => $obj->getEmail());
     $db->insert('users', $data);
 }