<?php
/**
* Inheritance: no
* Variants: no
Fields Summary:
- Image [image]
- Link [link]
- modal [checkbox]
- video [manyToOneRelation]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Magazin\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Magazin\Listing|\Pimcore\Model\DataObject\Magazin|null getByImage($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Magazin\Listing|\Pimcore\Model\DataObject\Magazin|null getByModal($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Magazin\Listing|\Pimcore\Model\DataObject\Magazin|null getByVideo($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Magazin extends Concrete
{
protected $o_classId = "Magazin";
protected $o_className = "Magazin";
protected $Image;
protected $Link;
protected $modal;
protected $video;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Magazin
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get Image - Image
* @return \Pimcore\Model\Asset\Image|null
*/
public function getImage(): ?\Pimcore\Model\Asset\Image
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Image");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->Image;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set Image - Image
* @param \Pimcore\Model\Asset\Image|null $Image
* @return \Pimcore\Model\DataObject\Magazin
*/
public function setImage(?\Pimcore\Model\Asset\Image $Image)
{
$this->Image = $Image;
return $this;
}
/**
* Get Link - Link
* @return \Pimcore\Model\DataObject\Data\Link|null
*/
public function getLink(): ?\Pimcore\Model\DataObject\Data\Link
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Link");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->Link;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set Link - Link
* @param \Pimcore\Model\DataObject\Data\Link|null $Link
* @return \Pimcore\Model\DataObject\Magazin
*/
public function setLink(?\Pimcore\Model\DataObject\Data\Link $Link)
{
$this->Link = $Link;
return $this;
}
/**
* Get modal - Modal
* @return bool|null
*/
public function getModal(): ?bool
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("modal");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->modal;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set modal - Modal
* @param bool|null $modal
* @return \Pimcore\Model\DataObject\Magazin
*/
public function setModal(?bool $modal)
{
$this->modal = $modal;
return $this;
}
/**
* Get video - Video
* @return \Pimcore\Model\Asset\Video|null
*/
public function getVideo(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("video");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("video")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set video - Video
* @param \Pimcore\Model\Asset\Video $video
* @return \Pimcore\Model\DataObject\Magazin
*/
public function setVideo(?\Pimcore\Model\Element\AbstractElement $video)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("video");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getVideo();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $video);
if (!$isEqual) {
$this->markFieldDirty("video", true);
}
$this->video = $fd->preSetData($this, $video);
return $this;
}
}