|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
OO question
look at following code:
class Lid { //Attributes var $mLidNr; var $mNaam; var $mGebDat; var $mAdres; function Lid( ) { this->mAdres=new Adres(); } function setAdres( $straat, $huisnr,$busnr, $postcode, $gemeente ){ $this->mAdres->setStraat(&$straat); $this->mAdres->setHuisNr(&$huisnr); $this->mAdres->setBusNr(&$busnr); $this->mAdres->setPostCode(&$postcode); $this->mAdres->setGemeente(&$gemeente); } } ... class temp(){ function storeLid($lid){ print $lid->getAdres()->getStraat(); } but the syntax $lid->getAdres()->getStraat(); doesn't seem to work, can someone help? |
|
#2
|
|||
|
|||
|
Does the function getAdres() return an object, presumably of class adres?
If not then that would be why it doesn't work. -KM- |
|
#3
|
|||
|
|||
|
it returns an object of class Adres...
|
|
#4
|
|||
|
|||
|
but i don't know if syntax of $this->mAdres->setStraat(&$straat) is correct...
|
|
#5
|
||||
|
||||
|
$this->mAdres->setStraat(&$straat) should be fine.
I don't think you can do $lid->getAdres()->getStraat() though. Assign $lid->getAdres() to its own variable and then have that variable execute getStraat(). |
|
#6
|
|||
|
|||
|
that works,
thanks |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > OO question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|