Ejemplo n.º 1
0
 /** Function for getting the county
  * @access public
  * @param array $data
  */
 public function updateAndProcess($data)
 {
     if (is_array($data)) {
         foreach ($data as $k => $v) {
             if ($v == "") {
                 $data[$k] = null;
             }
         }
     }
     if (array_key_exists('csrf', $data)) {
         unset($data['csrf']);
     }
     if (array_key_exists('countyID', $data) && !is_null($data['countyID'])) {
         $counties = new OsCounties();
         $data['county'] = $counties->fetchRow($counties->select()->where('osID = ?', $data['countyID']))->label;
     }
     return $data;
 }
Ejemplo n.º 2
0
 /** Function for updating findspots with processing of geodata
  * @access public
  * @param array $data
  * @return array
  */
 public function updateAndProcess(array $data)
 {
     if (is_array($data)) {
         foreach ($data as $k => $v) {
             if ($v == "") {
                 $data[$k] = null;
             }
         }
         if (!is_null($data['gridref'])) {
             $data = $this->_processFindspot($data);
         }
     }
     if (array_key_exists('csrf', $data)) {
         unset($data['csrf']);
     }
     if (array_key_exists('submit', $data)) {
         unset($data['submit']);
     }
     if (array_key_exists('organisername', $data)) {
         unset($data['organisername']);
     }
     if (array_key_exists('parishID', $data) && !is_null($data['parishID'])) {
         $parishes = new OsParishes();
         $data['parish'] = $parishes->fetchRow($parishes->select()->where('osID = ?', $data['parishID']))->label;
     }
     if (array_key_exists('countyID', $data) && !is_null($data['countyID'])) {
         $counties = new OsCounties();
         $data['county'] = $counties->fetchRow($counties->select()->where('osID = ?', $data['countyID']))->label;
     }
     if (array_key_exists('districtID', $data) && !is_null($data['districtID'])) {
         $district = new OsDistricts();
         $data['district'] = $district->fetchRow($district->select()->where('osID = ?', $data['districtID']))->label;
     }
     return $data;
 }