var/classes/DataObject/Location.php line 40

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - localizedfields [localizedfields]
  8.  * -- title [input]
  9.  * -- street [input]
  10.  * -- zip [input]
  11.  * -- city [input]
  12.  * - telephone [input]
  13.  * - fax [input]
  14.  * - email [input]
  15.  * - website [input]
  16.  * - zoomLevel [slider]
  17.  * - coordinates [geopoint]
  18.  */
  19. namespace Pimcore\Model\DataObject;
  20. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  21. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  22. /**
  23. * @method static \Pimcore\Model\DataObject\Location\Listing getList(array $config = [])
  24. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByStreet($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByZip($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByCity($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByTelephone($value, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByFax($value, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByEmail($value, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByWebsite($value, $limit = 0, $offset = 0, $objectTypes = null)
  33. * @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByZoomLevel($value, $limit = 0, $offset = 0, $objectTypes = null)
  34. */
  35. class Location extends Concrete
  36. {
  37. protected $o_classId "1";
  38. protected $o_className "Location";
  39. protected $localizedfields;
  40. protected $telephone;
  41. protected $fax;
  42. protected $email;
  43. protected $website;
  44. protected $zoomLevel;
  45. protected $coordinates;
  46. /**
  47. * @param array $values
  48. * @return \Pimcore\Model\DataObject\Location
  49. */
  50. public static function create($values = array()) {
  51.     $object = new static();
  52.     $object->setValues($values);
  53.     return $object;
  54. }
  55. /**
  56. * Get localizedfields - 
  57. * @return \Pimcore\Model\DataObject\Localizedfield|null
  58. */
  59. public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
  60. {
  61.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  62.         $preValue $this->preGetValue("localizedfields");
  63.         if ($preValue !== null) {
  64.             return $preValue;
  65.         }
  66.     }
  67.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  68.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  69.         return $data->getPlain();
  70.     }
  71.     return $data;
  72. }
  73. /**
  74. * Get title - Titel / Name
  75. * @return string|null
  76. */
  77. public function getTitle($language null): ?string
  78. {
  79.     $data $this->getLocalizedfields()->getLocalizedValue("title"$language);
  80.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  81.         $preValue $this->preGetValue("title");
  82.         if ($preValue !== null) {
  83.             return $preValue;
  84.         }
  85.     }
  86.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  87.         return $data->getPlain();
  88.     }
  89.     return $data;
  90. }
  91. /**
  92. * Get street - Straße und Nr.
  93. * @return string|null
  94. */
  95. public function getStreet($language null): ?string
  96. {
  97.     $data $this->getLocalizedfields()->getLocalizedValue("street"$language);
  98.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  99.         $preValue $this->preGetValue("street");
  100.         if ($preValue !== null) {
  101.             return $preValue;
  102.         }
  103.     }
  104.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  105.         return $data->getPlain();
  106.     }
  107.     return $data;
  108. }
  109. /**
  110. * Get zip - Postleitzahl
  111. * @return string|null
  112. */
  113. public function getZip($language null): ?string
  114. {
  115.     $data $this->getLocalizedfields()->getLocalizedValue("zip"$language);
  116.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  117.         $preValue $this->preGetValue("zip");
  118.         if ($preValue !== null) {
  119.             return $preValue;
  120.         }
  121.     }
  122.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  123.         return $data->getPlain();
  124.     }
  125.     return $data;
  126. }
  127. /**
  128. * Get city - Stadt
  129. * @return string|null
  130. */
  131. public function getCity($language null): ?string
  132. {
  133.     $data $this->getLocalizedfields()->getLocalizedValue("city"$language);
  134.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  135.         $preValue $this->preGetValue("city");
  136.         if ($preValue !== null) {
  137.             return $preValue;
  138.         }
  139.     }
  140.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  141.         return $data->getPlain();
  142.     }
  143.     return $data;
  144. }
  145. /**
  146. * Set localizedfields - 
  147. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  148. * @return \Pimcore\Model\DataObject\Location
  149. */
  150. public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
  151. {
  152.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  153.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  154.     $currentData $this->getLocalizedfields();
  155.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  156.     $this->markFieldDirty("localizedfields"true);
  157.     $this->localizedfields $localizedfields;
  158.     return $this;
  159. }
  160. /**
  161. * Set title - Titel / Name
  162. * @param string|null $title
  163. * @return \Pimcore\Model\DataObject\Location
  164. */
  165. public function setTitle (?string $title$language null)
  166. {
  167.     $isEqual false;
  168.     $this->getLocalizedfields()->setLocalizedValue("title"$title$language, !$isEqual);
  169.     return $this;
  170. }
  171. /**
  172. * Set street - Straße und Nr.
  173. * @param string|null $street
  174. * @return \Pimcore\Model\DataObject\Location
  175. */
  176. public function setStreet (?string $street$language null)
  177. {
  178.     $isEqual false;
  179.     $this->getLocalizedfields()->setLocalizedValue("street"$street$language, !$isEqual);
  180.     return $this;
  181. }
  182. /**
  183. * Set zip - Postleitzahl
  184. * @param string|null $zip
  185. * @return \Pimcore\Model\DataObject\Location
  186. */
  187. public function setZip (?string $zip$language null)
  188. {
  189.     $isEqual false;
  190.     $this->getLocalizedfields()->setLocalizedValue("zip"$zip$language, !$isEqual);
  191.     return $this;
  192. }
  193. /**
  194. * Set city - Stadt
  195. * @param string|null $city
  196. * @return \Pimcore\Model\DataObject\Location
  197. */
  198. public function setCity (?string $city$language null)
  199. {
  200.     $isEqual false;
  201.     $this->getLocalizedfields()->setLocalizedValue("city"$city$language, !$isEqual);
  202.     return $this;
  203. }
  204. /**
  205. * Get telephone - Telefon
  206. * @return string|null
  207. */
  208. public function getTelephone(): ?string
  209. {
  210.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  211.         $preValue $this->preGetValue("telephone");
  212.         if ($preValue !== null) {
  213.             return $preValue;
  214.         }
  215.     }
  216.     $data $this->telephone;
  217.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  218.         return $data->getPlain();
  219.     }
  220.     return $data;
  221. }
  222. /**
  223. * Set telephone - Telefon
  224. * @param string|null $telephone
  225. * @return \Pimcore\Model\DataObject\Location
  226. */
  227. public function setTelephone(?string $telephone)
  228. {
  229.     $this->telephone $telephone;
  230.     return $this;
  231. }
  232. /**
  233. * Get fax - Fax
  234. * @return string|null
  235. */
  236. public function getFax(): ?string
  237. {
  238.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  239.         $preValue $this->preGetValue("fax");
  240.         if ($preValue !== null) {
  241.             return $preValue;
  242.         }
  243.     }
  244.     $data $this->fax;
  245.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  246.         return $data->getPlain();
  247.     }
  248.     return $data;
  249. }
  250. /**
  251. * Set fax - Fax
  252. * @param string|null $fax
  253. * @return \Pimcore\Model\DataObject\Location
  254. */
  255. public function setFax(?string $fax)
  256. {
  257.     $this->fax $fax;
  258.     return $this;
  259. }
  260. /**
  261. * Get email - E-Mail
  262. * @return string|null
  263. */
  264. public function getEmail(): ?string
  265. {
  266.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  267.         $preValue $this->preGetValue("email");
  268.         if ($preValue !== null) {
  269.             return $preValue;
  270.         }
  271.     }
  272.     $data $this->email;
  273.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  274.         return $data->getPlain();
  275.     }
  276.     return $data;
  277. }
  278. /**
  279. * Set email - E-Mail
  280. * @param string|null $email
  281. * @return \Pimcore\Model\DataObject\Location
  282. */
  283. public function setEmail(?string $email)
  284. {
  285.     $this->email $email;
  286.     return $this;
  287. }
  288. /**
  289. * Get website - Internetseite
  290. * @return string|null
  291. */
  292. public function getWebsite(): ?string
  293. {
  294.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  295.         $preValue $this->preGetValue("website");
  296.         if ($preValue !== null) {
  297.             return $preValue;
  298.         }
  299.     }
  300.     $data $this->website;
  301.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  302.         return $data->getPlain();
  303.     }
  304.     return $data;
  305. }
  306. /**
  307. * Set website - Internetseite
  308. * @param string|null $website
  309. * @return \Pimcore\Model\DataObject\Location
  310. */
  311. public function setWebsite(?string $website)
  312. {
  313.     $this->website $website;
  314.     return $this;
  315. }
  316. /**
  317. * Get zoomLevel - Zoom-Stufe
  318. * @return float|null
  319. */
  320. public function getZoomLevel(): ?float
  321. {
  322.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  323.         $preValue $this->preGetValue("zoomLevel");
  324.         if ($preValue !== null) {
  325.             return $preValue;
  326.         }
  327.     }
  328.     $data $this->zoomLevel;
  329.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  330.         return $data->getPlain();
  331.     }
  332.     return $data;
  333. }
  334. /**
  335. * Set zoomLevel - Zoom-Stufe
  336. * @param float|null $zoomLevel
  337. * @return \Pimcore\Model\DataObject\Location
  338. */
  339. public function setZoomLevel(?float $zoomLevel)
  340. {
  341.     $this->zoomLevel $zoomLevel;
  342.     return $this;
  343. }
  344. /**
  345. * Get coordinates - Koordinaten
  346. * @return \Pimcore\Model\DataObject\Data\GeoCoordinates|null
  347. */
  348. public function getCoordinates(): ?\Pimcore\Model\DataObject\Data\GeoCoordinates
  349. {
  350.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  351.         $preValue $this->preGetValue("coordinates");
  352.         if ($preValue !== null) {
  353.             return $preValue;
  354.         }
  355.     }
  356.     $data $this->coordinates;
  357.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  358.         return $data->getPlain();
  359.     }
  360.     return $data;
  361. }
  362. /**
  363. * Set coordinates - Koordinaten
  364. * @param \Pimcore\Model\DataObject\Data\GeoCoordinates|null $coordinates
  365. * @return \Pimcore\Model\DataObject\Location
  366. */
  367. public function setCoordinates(?\Pimcore\Model\DataObject\Data\GeoCoordinates $coordinates)
  368. {
  369.     $this->coordinates $coordinates;
  370.     return $this;
  371. }
  372. }