Skip to content

Instantly share code, notes, and snippets.

@julianobailao
Created August 31, 2016 18:30
Show Gist options
  • Save julianobailao/b25881e4ed9fff838c78904cd8181548 to your computer and use it in GitHub Desktop.
Save julianobailao/b25881e4ed9fff838c78904cd8181548 to your computer and use it in GitHub Desktop.
Customer class
<?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