Beispiel #1
0
 /**
  * @see EntityInterface::save()
  */
 public function save()
 {
     parent::_save();
     // Save
 }
Beispiel #2
0
 /**
  *
  * @see ApineEntityInterface::save()
  */
 public function save()
 {
     if (is_null($this->creation_date)) {
         $this->creation_date = date('Y-m-d H:i:s', time());
         $this->_set_field('creation_date', $this->creation_date);
     }
     if (is_null($this->last_access_date)) {
         $this->last_access_date = date('Y-m-d H:i:s', time());
         $this->_set_field('last_access_date', $this->last_access_date);
     }
     if (is_null($this->token) || is_null($this->user)) {
         throw new Apine\Exception\GenericException('Missing values', 500);
     }
     parent::_save();
     $this->set_id($this->_get_id());
 }
 /**
  *
  * @see ApineEntityInterface::save()
  */
 public function save()
 {
     if (is_null($this->token) || is_null($this->user)) {
         throw new Apine\Exception\GenericException('Missing values', 500);
     }
     parent::_save();
     $this->set_id($this->_get_id());
 }
Beispiel #4
0
 /**
  * @see EntityInterface::save()
  */
 public function save()
 {
     parent::_save();
     $this->set_id($this->_get_id());
     if ($this->get_group()->length() > 0) {
         $db = new Apine\Core\Database();
         $db->delete('apine_users_user_groups', array("user_id" => $this->get_id()));
         foreach ($this->get_group() as $item) {
             $db->insert('apine_users_user_groups', array("user_id" => $this->get_id(), "group_id" => $item->get_id()));
         }
     }
     if (count($this->properties) > 0) {
         foreach ($this->properties as $item) {
             $item->save();
         }
     }
 }
Beispiel #5
0
 /**
  * @see Entity\EntityInterface::save()
  */
 public function save()
 {
     parent::_save();
     $this->set_id($this->_get_id());
 }