Exemplo n.º 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->aMlbTeamRef) {
         $this->aMlbTeamRef->removePlayers($this);
     }
     if (null !== $this->aCardRef) {
         $this->aCardRef->removePlayers($this);
     }
     if (null !== $this->aDivisionRef) {
         $this->aDivisionRef->removePlayers($this);
     }
     if (null !== $this->aPositionRef) {
         $this->aPositionRef->removePlayers($this);
     }
     if (null !== $this->aTeams) {
         $this->aTeams->removePlayers($this);
     }
     $this->id = null;
     $this->lastn = null;
     $this->bats = null;
     $this->bday = null;
     $this->age = null;
     $this->mlb = null;
     $this->draft_year = null;
     $this->position = null;
     $this->card = null;
     $this->d_e = null;
     $this->lg = null;
     $this->mwbl = null;
     $this->category = null;
     $this->comment = null;
     $this->mwbl_link = null;
     $this->mlb_link = null;
     $this->mwbl_link_enabled = null;
     $this->mlb_link_enabled = null;
     $this->create_ts = null;
     $this->maint_ts = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->applyDefaultValues();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }