/** Update system for a treasure action
  * @param array $data 
  * @return boolean
  */
 public function updateTreasure($data)
 {
     if (!isset($data['updated']) || $data['updated'] instanceof Zend_Db_Expr) {
         $data['updated'] = $this->_time;
     }
     $where = parent::getAdapter()->quoteInto('treasureID = ?', $this->_treasureID);
     $data['updatedBy'] = $this->_auth->getIdentity()->id;
     return parent::update($data, $where);
 }
 /** Update system for a treasure action
  * @access public
  * @param array $data
  * @return integer
  */
 public function updateTreasure(array $data)
 {
     if (!isset($data['updated']) || $data['updated'] instanceof Zend_Db_Expr) {
         $data['updated'] = $this->timeCreation();
     }
     $where = parent::getAdapter()->quoteInto('treasureID = ?', $this->getTreasureID());
     $data['updatedBy'] = $this->getUserNumber();
     return parent::update($data, $where);
 }
示例#3
0
 public function activate($data)
 {
     $where = array();
     foreach ($data as $k => $v) {
         $where[] = $this->getAdapter()->quoteInto($k . ' = ?', $v);
     }
     $data = array('valid' => '1', 'activationKey' => NULL);
     $perm = 0775;
     mkdir(PATH . $username, $perm);
     mkdir(PATH . $username . '/small/', $perm);
     mkdir(PATH . $username . '/medium/', $perm);
     mkdir(PATH . $username . '/display/', $perm);
     mkdir(PATH . $username . '/zoom/', $perm);
     parent::update($data, $where);
 }
示例#4
0
 /** Update a coroner
  * @access public
  * @param array $data
  * @param integer $id
  */
 public function updateCoroner(array $data, $id)
 {
     $updateData = $this->_geocodeAddress($data);
     $where = $this->getAdapter()->quoteInto($this->_primary . '= ?', (int) $id);
     $this->_cache->remove('coroner' . $id);
     return parent::update($updateData, $where);
 }
示例#5
0
 /** Update the news
  * @access public
  * @param array $data
  * @param integer $id
  * @return array
  */
 public function updateNews(array $data, $id)
 {
     $coords = $this->getCoords($data['primaryNewsLocation']);
     if (empty($data['updated'])) {
         $data['updated'] = $this->timeCreation();
     }
     if (empty($data['updatedBy'])) {
         $data['updatedBy'] = $this->getUserNumber();
     }
     $clean = array_merge($data, $coords);
     $where = array();
     $where[] = $this->getAdapter()->quoteInto($this->_primary . ' = ?', $id);
     return parent::update($clean, $where);
 }
示例#6
0
 /** Activate an account
  * @access public
  * @param array $data
  * @return integer
  */
 public function activate(array $data)
 {
     unset($data['csrf']);
     $where = array();
     $where[] = $this->getAdapter()->quoteInto('activationKey = ?', $data['activationKey']);
     $where[] = $this->getAdapter()->quoteInto('username = ?', $data['username']);
     $where[] = $this->getAdapter()->quoteInto('email = ?', $data['email']);
     $data = array('valid' => 1, 'activationKey' => null);
     $username = $data['username'];
     $perm = 0775;
     mkdir(IMAGE_PATH . $username, $perm);
     mkdir(IMAGE_PATH . $username . '/small/', $perm);
     mkdir(IMAGE_PATH . $username . '/medium/', $perm);
     mkdir(IMAGE_PATH . $username . '/display/', $perm);
     mkdir(IMAGE_PATH . $username . '/zoom/', $perm);
     return parent::update($data, $where);
 }
示例#7
0
 public function updateNews($data, $id)
 {
     $coords = $this->_geocoder->getCoordinates($data['primaryNewsLocation']);
     if ($coords) {
         ${$data}['latitude'] = $coords['lat'];
         ${$data}['longitude'] = $coords['lon'];
         $place = $this->_geoPlanet->reverseGeoCode($lat, $lon);
         $data['woeid'] = $place['woeid'];
     } else {
         ${$data}['latitude'] = NULL;
         ${$data}['longitude'] = NULL;
         $data['woeid'] = NULL;
     }
     $where = array();
     $where[] = $this->getAdapter()->quoteInto($this->_primary . ' = ?', $id);
     return parent::update($data, $where);
 }
示例#8
0
 public function updateCoroner($data, $id)
 {
     if (is_array($data)) {
         $address = $data['address_1'] . ',' . $data['address_2'] . ',' . $data['town'] . ',' . $data['county'] . ',' . $data['postcode'] . ',' . $data['country'];
         $coords = $this->_geocoder->getCoordinates($address);
         if ($coords) {
             ${$data}['latitude'] = $coords['lat'];
             ${$data}['longitude'] = $coords['lon'];
             $place = $this->_geoPlanet->reverseGeoCode($lat, $lon);
             $data['woeid'] = $place['woeid'];
         } else {
             ${$data}['latitude'] = NULL;
             ${$data}['longitude'] = NULL;
             $data['woeid'] = NULL;
         }
         $where = $this->getAdapter()->quoteInto($this->_primary . '= ?', (int) $id);
         return parent::update($data, $where);
     } else {
         throw new Exception('Data must be in array format');
     }
 }