29 public static function convertFieldsToOrm(
Location $location): EO_LocationField_Collection
38 ->setType($field->getType())
39 ->setValue($field->getValue())
40 ->setLocationId($location->
getId())
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())
70 foreach($fields as $field)
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)
104 public static function createCollection(EO_Location_Collection $collection,
string $language):
Location\Collection
109 foreach ($collection as $item)
112 self::createLocation($item, $language)
128 public static function createParentCollection(EO_Hierarchy_Collection $ormHierarchy,
string $languageId):
Location\Parents
133 foreach ($ormHierarchy as $item)
136 self::createLocation(
137 $item->getAncestor(),
static createCollection()
static createObject($setDefaultValues=true)