<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - localizedfields [localizedfields]
* -- title [input]
* -- street [input]
* -- zip [input]
* -- city [input]
* - telephone [input]
* - fax [input]
* - email [input]
* - website [input]
* - zoomLevel [slider]
* - coordinates [geopoint]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Location\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByStreet($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByZip($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByCity($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByTelephone($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByFax($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByEmail($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByWebsite($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Location\Listing|\Pimcore\Model\DataObject\Location|null getByZoomLevel($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Location extends Concrete
{
protected $o_classId = "1";
protected $o_className = "Location";
protected $localizedfields;
protected $telephone;
protected $fax;
protected $email;
protected $website;
protected $zoomLevel;
protected $coordinates;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Location
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get localizedfields -
* @return \Pimcore\Model\DataObject\Localizedfield|null
*/
public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("localizedfields");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get title - Titel / Name
* @return string|null
*/
public function getTitle($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("title", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("title");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get street - Straße und Nr.
* @return string|null
*/
public function getStreet($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("street", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("street");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get zip - Postleitzahl
* @return string|null
*/
public function getZip($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("zip", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("zip");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get city - Stadt
* @return string|null
*/
public function getCity($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("city", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("city");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set localizedfields -
* @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
* @return \Pimcore\Model\DataObject\Location
*/
public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
{
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getLocalizedfields();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$this->markFieldDirty("localizedfields", true);
$this->localizedfields = $localizedfields;
return $this;
}
/**
* Set title - Titel / Name
* @param string|null $title
* @return \Pimcore\Model\DataObject\Location
*/
public function setTitle (?string $title, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("title", $title, $language, !$isEqual);
return $this;
}
/**
* Set street - Straße und Nr.
* @param string|null $street
* @return \Pimcore\Model\DataObject\Location
*/
public function setStreet (?string $street, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("street", $street, $language, !$isEqual);
return $this;
}
/**
* Set zip - Postleitzahl
* @param string|null $zip
* @return \Pimcore\Model\DataObject\Location
*/
public function setZip (?string $zip, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("zip", $zip, $language, !$isEqual);
return $this;
}
/**
* Set city - Stadt
* @param string|null $city
* @return \Pimcore\Model\DataObject\Location
*/
public function setCity (?string $city, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("city", $city, $language, !$isEqual);
return $this;
}
/**
* Get telephone - Telefon
* @return string|null
*/
public function getTelephone(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("telephone");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->telephone;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set telephone - Telefon
* @param string|null $telephone
* @return \Pimcore\Model\DataObject\Location
*/
public function setTelephone(?string $telephone)
{
$this->telephone = $telephone;
return $this;
}
/**
* Get fax - Fax
* @return string|null
*/
public function getFax(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("fax");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->fax;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set fax - Fax
* @param string|null $fax
* @return \Pimcore\Model\DataObject\Location
*/
public function setFax(?string $fax)
{
$this->fax = $fax;
return $this;
}
/**
* Get email - E-Mail
* @return string|null
*/
public function getEmail(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("email");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->email;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set email - E-Mail
* @param string|null $email
* @return \Pimcore\Model\DataObject\Location
*/
public function setEmail(?string $email)
{
$this->email = $email;
return $this;
}
/**
* Get website - Internetseite
* @return string|null
*/
public function getWebsite(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("website");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->website;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set website - Internetseite
* @param string|null $website
* @return \Pimcore\Model\DataObject\Location
*/
public function setWebsite(?string $website)
{
$this->website = $website;
return $this;
}
/**
* Get zoomLevel - Zoom-Stufe
* @return float|null
*/
public function getZoomLevel(): ?float
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("zoomLevel");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->zoomLevel;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set zoomLevel - Zoom-Stufe
* @param float|null $zoomLevel
* @return \Pimcore\Model\DataObject\Location
*/
public function setZoomLevel(?float $zoomLevel)
{
$this->zoomLevel = $zoomLevel;
return $this;
}
/**
* Get coordinates - Koordinaten
* @return \Pimcore\Model\DataObject\Data\GeoCoordinates|null
*/
public function getCoordinates(): ?\Pimcore\Model\DataObject\Data\GeoCoordinates
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("coordinates");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->coordinates;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set coordinates - Koordinaten
* @param \Pimcore\Model\DataObject\Data\GeoCoordinates|null $coordinates
* @return \Pimcore\Model\DataObject\Location
*/
public function setCoordinates(?\Pimcore\Model\DataObject\Data\GeoCoordinates $coordinates)
{
$this->coordinates = $coordinates;
return $this;
}
}