<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - infosnowId [input]
* - localizedfields [localizedfields]
* -- name [input]
* -- snippet [manyToOneRelation]
* - openLiftCount [numeric]
* - totalLiftCount [numeric]
* - openSlopeLength [numeric]
* - totalSlopeLength [numeric]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Resort\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByInfosnowId($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getBySnippet($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByOpenLiftCount($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByTotalLiftCount($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByOpenSlopeLength($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByTotalSlopeLength($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Resort extends Concrete
{
protected $o_classId = "Resort";
protected $o_className = "Resort";
protected $infosnowId;
protected $localizedfields;
protected $openLiftCount;
protected $totalLiftCount;
protected $openSlopeLength;
protected $totalSlopeLength;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Resort
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get infosnowId - Infosnow Id
* @return string|null
*/
public function getInfosnowId(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("infosnowId");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->infosnowId;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set infosnowId - Infosnow Id
* @param string|null $infosnowId
* @return \Pimcore\Model\DataObject\Resort
*/
public function setInfosnowId(?string $infosnowId)
{
$this->infosnowId = $infosnowId;
return $this;
}
/**
* 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 name - Name
* @return string|null
*/
public function getName($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("name", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("name");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get snippet - Card Teaser Snippet
* @return \Pimcore\Model\Document\Snippet|null
*/
public function getSnippet($language = null): ?\Pimcore\Model\Element\AbstractElement
{
$data = $this->getLocalizedfields()->getLocalizedValue("snippet", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("snippet");
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\Resort
*/
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 name - Name
* @param string|null $name
* @return \Pimcore\Model\DataObject\Resort
*/
public function setName (?string $name, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("name", $name, $language, !$isEqual);
return $this;
}
/**
* Set snippet - Card Teaser Snippet
* @param \Pimcore\Model\Document\Snippet|null $snippet
* @return \Pimcore\Model\DataObject\Resort
*/
public function setSnippet (?\Pimcore\Model\Element\AbstractElement $snippet, $language = null)
{
$fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("snippet");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getSnippet($language);
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $snippet);
if (!$isEqual) {
$this->markFieldDirty("snippet", true);
}
$this->getLocalizedfields()->setLocalizedValue("snippet", $snippet, $language, !$isEqual);
return $this;
}
/**
* Get openLiftCount - Open Lift Count
* @return float|null
*/
public function getOpenLiftCount(): ?float
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("openLiftCount");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->openLiftCount;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set openLiftCount - Open Lift Count
* @param float|null $openLiftCount
* @return \Pimcore\Model\DataObject\Resort
*/
public function setOpenLiftCount(?float $openLiftCount)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
$fd = $this->getClass()->getFieldDefinition("openLiftCount");
$this->openLiftCount = $fd->preSetData($this, $openLiftCount);
return $this;
}
/**
* Get totalLiftCount - Total Lift Count
* @return float|null
*/
public function getTotalLiftCount(): ?float
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("totalLiftCount");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->totalLiftCount;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set totalLiftCount - Total Lift Count
* @param float|null $totalLiftCount
* @return \Pimcore\Model\DataObject\Resort
*/
public function setTotalLiftCount(?float $totalLiftCount)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
$fd = $this->getClass()->getFieldDefinition("totalLiftCount");
$this->totalLiftCount = $fd->preSetData($this, $totalLiftCount);
return $this;
}
/**
* Get openSlopeLength - Open Slope Length
* @return float|null
*/
public function getOpenSlopeLength(): ?float
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("openSlopeLength");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->openSlopeLength;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set openSlopeLength - Open Slope Length
* @param float|null $openSlopeLength
* @return \Pimcore\Model\DataObject\Resort
*/
public function setOpenSlopeLength(?float $openSlopeLength)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
$fd = $this->getClass()->getFieldDefinition("openSlopeLength");
$this->openSlopeLength = $fd->preSetData($this, $openSlopeLength);
return $this;
}
/**
* Get totalSlopeLength - Total Slope Length
* @return float|null
*/
public function getTotalSlopeLength(): ?float
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("totalSlopeLength");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->totalSlopeLength;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set totalSlopeLength - Total Slope Length
* @param float|null $totalSlopeLength
* @return \Pimcore\Model\DataObject\Resort
*/
public function setTotalSlopeLength(?float $totalSlopeLength)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
$fd = $this->getClass()->getFieldDefinition("totalSlopeLength");
$this->totalSlopeLength = $fd->preSetData($this, $totalSlopeLength);
return $this;
}
}