Slide 5
Slide 5 text
class Clinic
{
public function __construct($name, TaxIdNumber $taxIdNumber)
{
$this->name = $name;
$this->taxIdNumber = $taxIdNumbr;
}
public function hire(Candidate $cadidate)
{
if ($this->employeeAlreadyExists($candidate->getTaxIdNumber())) {
throw new \LogicException(sprtinf('We found %s employee already
in clinic', $candiate->getTaxIdNumber()));
}
$this->employees[] = Employee::createFromCandiate($candidate);
}
}
@cocoders
Model zhermetyzowany