var/classes/DataObject/Location.php line 32

Open in your IDE?
  1. <?php
  2. /**
  3. * Inheritance: no
  4. * Variants: no
  5. Fields Summary:
  6. - localizedfields [localizedfields]
  7. -- name [input]
  8. - groupKey [input]
  9. - ltsGeoareasMapping [block]
  10. -- fid [input]
  11. - ltsDistrictsMapping [block]
  12. -- fid [input]
  13. - oaRegionsMapping [block]
  14. -- ooId [input]
  15. */
  16. namespace Pimcore\Model\DataObject;
  17. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  18. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  19. /**
  20. * @method static \Pimcore\Model\DataObject\Location\Listing getList(array $config = [])
  21. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByGroupKey($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. */
  25. class Location extends Concrete
  26. {
  27. protected $o_classId "location";
  28. protected $o_className "Location";
  29. protected $localizedfields;
  30. protected $groupKey;
  31. protected $ltsGeoareasMapping;
  32. protected $ltsDistrictsMapping;
  33. protected $oaRegionsMapping;
  34. /**
  35. * @param array $values
  36. * @return \Pimcore\Model\DataObject\Location
  37. */
  38. public static function create($values = array()) {
  39.     $object = new static();
  40.     $object->setValues($values);
  41.     return $object;
  42. }
  43. /**
  44. * Get localizedfields - 
  45. * @return \Pimcore\Model\DataObject\Localizedfield|null
  46. */
  47. public function getLocalizedfields()
  48. {
  49.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  50.         $preValue $this->preGetValue("localizedfields");
  51.         if ($preValue !== null) {
  52.             return $preValue;
  53.         }
  54.     }
  55.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  56.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  57.         return $data->getPlain();
  58.     }
  59.     return $data;
  60. }
  61. /**
  62. * Get name - Nome
  63. * @return string|null
  64. */
  65. public function getName($language null)
  66. {
  67.     $data $this->getLocalizedfields()->getLocalizedValue("name"$language);
  68.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  69.         $preValue $this->preGetValue("name");
  70.         if ($preValue !== null) {
  71.             return $preValue;
  72.         }
  73.     }
  74.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  75.         return $data->getPlain();
  76.     }
  77.     return $data;
  78. }
  79. /**
  80. * Set localizedfields - 
  81. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  82. * @return \Pimcore\Model\DataObject\Location
  83. */
  84. public function setLocalizedfields($localizedfields)
  85. {
  86.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  87.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  88.     $currentData $this->getLocalizedfields();
  89.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  90.     $this->markFieldDirty("localizedfields"true);
  91.     $this->localizedfields $localizedfields;
  92.     return $this;
  93. }
  94. /**
  95. * Set name - Nome
  96. * @param string|null $name
  97. * @return \Pimcore\Model\DataObject\Location
  98. */
  99. public function setName ($name$language null)
  100. {
  101.     $isEqual false;
  102.     $this->getLocalizedfields()->setLocalizedValue("name"$name$language, !$isEqual);
  103.     return $this;
  104. }
  105. /**
  106. * Get groupKey - Group Key
  107. * @return string|null
  108. */
  109. public function getGroupKey()
  110. {
  111.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  112.         $preValue $this->preGetValue("groupKey");
  113.         if ($preValue !== null) {
  114.             return $preValue;
  115.         }
  116.     }
  117.     $data $this->groupKey;
  118.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  119.         return $data->getPlain();
  120.     }
  121.     return $data;
  122. }
  123. /**
  124. * Set groupKey - Group Key
  125. * @param string|null $groupKey
  126. * @return \Pimcore\Model\DataObject\Location
  127. */
  128. public function setGroupKey($groupKey)
  129. {
  130.     $this->groupKey $groupKey;
  131.     return $this;
  132. }
  133. /**
  134. * Get ltsGeoareasMapping - Geoareas Mapping
  135. * @return \Pimcore\Model\DataObject\Data\BlockElement[][]
  136. */
  137. public function getLtsGeoareasMapping()
  138. {
  139.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  140.         $preValue $this->preGetValue("ltsGeoareasMapping");
  141.         if ($preValue !== null) {
  142.             return $preValue;
  143.         }
  144.     }
  145.     $data $this->getClass()->getFieldDefinition("ltsGeoareasMapping")->preGetData($this);
  146.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  147.         return $data->getPlain();
  148.     }
  149.     return $data;
  150. }
  151. /**
  152. * Set ltsGeoareasMapping - Geoareas Mapping
  153. * @param \Pimcore\Model\DataObject\Data\BlockElement[][] $ltsGeoareasMapping
  154. * @return \Pimcore\Model\DataObject\Location
  155. */
  156. public function setLtsGeoareasMapping($ltsGeoareasMapping)
  157. {
  158.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
  159.     $fd $this->getClass()->getFieldDefinition("ltsGeoareasMapping");
  160.     $this->ltsGeoareasMapping $fd->preSetData($this$ltsGeoareasMapping);
  161.     return $this;
  162. }
  163. /**
  164. * Get ltsDistrictsMapping - Districts Mapping
  165. * @return \Pimcore\Model\DataObject\Data\BlockElement[][]
  166. */
  167. public function getLtsDistrictsMapping()
  168. {
  169.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  170.         $preValue $this->preGetValue("ltsDistrictsMapping");
  171.         if ($preValue !== null) {
  172.             return $preValue;
  173.         }
  174.     }
  175.     $data $this->getClass()->getFieldDefinition("ltsDistrictsMapping")->preGetData($this);
  176.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  177.         return $data->getPlain();
  178.     }
  179.     return $data;
  180. }
  181. /**
  182. * Set ltsDistrictsMapping - Districts Mapping
  183. * @param \Pimcore\Model\DataObject\Data\BlockElement[][] $ltsDistrictsMapping
  184. * @return \Pimcore\Model\DataObject\Location
  185. */
  186. public function setLtsDistrictsMapping($ltsDistrictsMapping)
  187. {
  188.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
  189.     $fd $this->getClass()->getFieldDefinition("ltsDistrictsMapping");
  190.     $this->ltsDistrictsMapping $fd->preSetData($this$ltsDistrictsMapping);
  191.     return $this;
  192. }
  193. /**
  194. * Get oaRegionsMapping - Regions Mapping
  195. * @return \Pimcore\Model\DataObject\Data\BlockElement[][]
  196. */
  197. public function getOaRegionsMapping()
  198. {
  199.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  200.         $preValue $this->preGetValue("oaRegionsMapping");
  201.         if ($preValue !== null) {
  202.             return $preValue;
  203.         }
  204.     }
  205.     $data $this->getClass()->getFieldDefinition("oaRegionsMapping")->preGetData($this);
  206.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  207.         return $data->getPlain();
  208.     }
  209.     return $data;
  210. }
  211. /**
  212. * Set oaRegionsMapping - Regions Mapping
  213. * @param \Pimcore\Model\DataObject\Data\BlockElement[][] $oaRegionsMapping
  214. * @return \Pimcore\Model\DataObject\Location
  215. */
  216. public function setOaRegionsMapping($oaRegionsMapping)
  217. {
  218.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
  219.     $fd $this->getClass()->getFieldDefinition("oaRegionsMapping");
  220.     $this->oaRegionsMapping $fd->preSetData($this$oaRegionsMapping);
  221.     return $this;
  222. }
  223. }