Exemplo n.º 1
0
 /** Update the config
  * @access public
  * @param array $data The update data
  * @return int
  */
 public function updateConfig(array $data)
 {
     if (array_key_exists('csrf', $data)) {
         unset($data['csrf']);
     }
     foreach ($data as $key => $value) {
         if (is_null($value) || $value === '' || $value === '0') {
             unset($data[$key]);
         }
     }
     $newFields = array_keys($data);
     $updateData['fields'] = serialize($newFields);
     $updateData['created'] = $this->timeCreation();
     $updateData['createdBy'] = $this->getUserNumber();
     $updateData['userID'] = $this->getUserNumber();
     parent::delete('userID =' . $this->getUserNumber());
     return parent::insert($updateData);
 }
Exemplo n.º 2
0
 /** Update the config for each user
  * @access public
  * @param $data
  */
 public function updateConfig($data)
 {
     if (array_key_exists('csrf', $data)) {
         unset($data['csrf']);
     }
     $updateData['uri'] = $data['uri'];
     $updateData['created'] = $this->timeCreation();
     $updateData['createdBy'] = $this->getUserNumber();
     $updateData['userID'] = $this->getUserNumber();
     //Delete the existing menu option
     parent::delete('userID =' . $this->getUserNumber());
     //Insert the new option
     return parent::insert($updateData);
 }