/** * Convert properties to array. * * @return array The */ public function toArray() { $array = array('firstName' => $this->firstName, 'lastName' => $this->lastName, 'email' => $this->email, 'telephone' => $this->phoneNumber, 'mobile' => $this->mobileNumber, 'companyName' => $this->companyName); if ($this->address !== null) { $array['address'] = $this->address->toArray(); } return $array; }
/** * Creates an Address. * * @return Address */ protected function makeAddress() { $address = new Address(); $address->configure(array('streetAddress' => 'Test street 1', 'postalCode' => '12345', 'postOffice' => 'Helsinki', 'countryCode' => 'FI')); return $address; }