public function load(ObjectManager $manager)
{
/**
* @var ObjectDirector $zoneDirector
*/
$zones = $this->parseYaml(dirname(__FILE__) . '/zones.yml');
$zoneDirector = $this->getDirector('zone');
$zoneCollection = new ArrayCollection();
foreach ($zones as $zoneName => $locations) {
$zoneCode = strtolower(trim(preg_replace('~[^a-zA-Z\\d]{1}~', '', $zoneName)));
$zone = $zoneDirector->create()->setName($zoneName)->setCode($zoneCode)->setLocations($locations);
$zoneCollection->add($zone);
$this->setReference('zone-' . $zoneCode, $zone);
$zoneDirector->save($zone);
}
$this->setReference('zone-collection', $zoneCollection);
}