Slide 28
Slide 28 text
class SettingUpClinic
{
public function execute(SettingUpClinic\Command $command)
{
$services = array_map(function ($serviceName) {
return new Clinic\Service($serviceName);
}, $command->services);
$clinic = new Clinic(
$command->name,
new Clinic\Address(
$command->postalCode,
$command->city,
$command->street
),
$services,
new Clinic\TaxIdentificationNumber($command->taxIdNumber),
new Clinic\NationalEconomyRegisterNumber(
$command->nationalRegistryNumber
)
);
$this->registry->add($clinic);
}