Example #1
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aStation) {
         $this->aStation->removeSession($this);
     }
     if (null !== $this->aAdministrator) {
         $this->aAdministrator->removeSession($this);
     }
     $this->id = null;
     $this->station_id = null;
     $this->administrator_id = null;
     $this->duration = null;
     $this->duration_end_time = null;
     $this->start_time = null;
     $this->end_time = null;
     $this->cost = null;
     $this->is_paid = null;
     $this->comment = null;
     $this->is_in_session = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->applyDefaultValues();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }