Created
August 31, 2016 18:30
-
-
Save julianobailao/b25881e4ed9fff838c78904cd8181548 to your computer and use it in GitHub Desktop.
Customer class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Customer | |
{ | |
/** | |
* Customer name. | |
* | |
* @var string | |
*/ | |
protected $name; | |
/** | |
* Customer addresses. | |
* | |
* @var Collection | |
*/ | |
protected $addresses; | |
/** | |
* Create a new customer instance. | |
* | |
* @param string $nameVal | |
*/ | |
public function __construct($nameVal) | |
{ | |
$this->name = $nameVal; | |
$this->addresses = new Raidros\Collection\Collection(Address::class); | |
} | |
/** | |
* Gets addresses collection object. | |
* | |
* @return Raidros\Collection\Collection | |
*/ | |
public function address() | |
{ | |
return $this->addresses; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment