13 public static function createLocation(EO_Location $ormLocation,
string $languageId):
Location
16 ->setId($ormLocation->getId())
17 ->setCode($ormLocation->getCode())
18 ->setExternalId($ormLocation->getExternalId())
19 ->setSourceCode($ormLocation->getSourceCode())
20 ->setType(($ormLocation->getType()))
21 ->setLatitude($ormLocation->getLatitude())
22 ->setLongitude($ormLocation->getLongitude());
24 if($fields = $ormLocation->getFields())
27 foreach($fields as $field)
29 $result->
setFieldValue($field->getType(), $field->getValue());
33 foreach($ormLocation->getName() as $ormName)
35 if($ormName->getLanguageId() === $languageId || $ormName->getLanguageId() ==
'')
37 $result->setName($ormName->getName());
38 $result->setLanguageId($ormName->getLanguageId());
40 if($ormName->getLanguageId() === $languageId)
50 public static function createCollection(EO_Location_Collection $collection,
string $language)
54 foreach ($collection as $item)
57 self::createLocation($item, $language)
67 foreach ($ormHierarchy as $item)