34 foreach (
$location->getFieldCollection() as $field)
38 ->setType($field->getType())
39 ->setValue($field->getValue())
56 public static function createLocation(
EO_Location $ormLocation,
string $languageId):
Location
59 ->setId($ormLocation->getId())
60 ->setCode($ormLocation->getCode())
61 ->setExternalId($ormLocation->getExternalId())
62 ->setSourceCode($ormLocation->getSourceCode())
63 ->setType(($ormLocation->getType()))
64 ->setLatitude($ormLocation->getLatitude())
65 ->setLongitude($ormLocation->getLongitude());
67 if(
$fields = $ormLocation->getFields())
72 $result->setFieldValue($field->getType(), $field->getValue());
77 foreach($ormLocation->getName() as $ormName)
79 if($ormName->getLanguageId() === $languageId || $ormName->getLanguageId() ===
'')
81 $result->setName($ormName->getName());
82 $result->setLanguageId($ormName->getLanguageId());
84 if($ormName->getLanguageId() === $languageId)
109 foreach ($collection as $item)
112 self::createLocation($item, $language)
133 foreach ($ormHierarchy as $item)
136 self::createLocation(
137 $item->getAncestor(),
static createCollection()
static createObject($setDefaultValues=true)