number = $numberIn; } */ /** * Get- and Set-methods for persistent variables. The default * behaviour does not make any checks against malformed data, * so these might require some manual additions. */ function getNumber() { return $this->number; } function setNumber($numberIn) { $this->number = $numberIn; } function getName() { return $this->name; } function setName($nameIn) { $this->name = $nameIn; } function getAddress() { return $this->address; } function setAddress($addressIn) { $this->address = $addressIn; } function getCreated() { return $this->created; } function setCreated($createdIn) { $this->created = $createdIn; } function getBalance() { return $this->balance; } function setBalance($balanceIn) { $this->balance = $balanceIn; } /** * setAll allows to set all persistent variables in one method call. * This is useful, when all data is available and it is needed to * set the initial state of this object. Note that this method will * directly modify instance variales, without going trough the * individual set-methods. */ function setAll($numberIn, $nameIn, $addressIn, $createdIn, $balanceIn) { $this->number = $numberIn; $this->name = $nameIn; $this->address = $addressIn; $this->created = $createdIn; $this->balance = $balanceIn; } /** * hasEqualMapping-method will compare two Customer instances * and return true if they contain same values in all persistent instance * variables. If hasEqualMapping returns true, it does not mean the objects * are the same instance. However it does mean that in that moment, they * are mapped to the same row in database. */ function hasEqualMapping($valueObject) { if ($valueObject.getNumber() != $this->number) { return(false); } if ($valueObject.getName() != $this->name) { return(false); } if ($valueObject.getAddress() != $this->address) { return(false); } if ($valueObject.getCreated() != $this->created) { return(false); } if ($valueObject.getBalance() != $this->balance) { return(false); } return true; } /** * toString will return String object representing the state of this * valueObject. This is useful during application development, and * possibly when application is writing object states in textlog. */ function toString() { $out = $this->getDaogenVersion(); $out = $out."\nclass Customer, representing table CUSTOMER\n"; $out = $out."Persistent attributes: \n"; $out = $out."number = ".$this->number."\n"; $out = $out."name = ".$this->name."\n"; $out = $out."address = ".$this->address."\n"; $out = $out."created = ".$this->created."\n"; $out = $out."balance = ".$this->balance."\n"; $out = $out."Non persistent attributes: \n"; return $out; } /** * Clone will return identical deep copy of this valueObject. * Note, that this method is different than the clone() which * is defined in java.lang.Object. Here, the retuned cloned object * will also have all its attributes cloned. */ function clone() { $cloned = new Customer(); $cloned->setNumber($this->number); $cloned->setName($this->name); $cloned->setAddress($this->address); $cloned->setCreated($this->created); $cloned->setBalance($this->balance); return $cloned; } /** * getDaogenVersion will return information about * generator which created these sources. */ function getDaogenVersion() { return "DaoGen version 2.2.1"; } } ?>