<?php
/**
* Inheritance: no
* Variants: no
Fields Summary:
- Title [input]
- text [textarea]
- colorLeft [select]
- colorRight [select]
- Image [image]
- snippet [manyToOneRelation]
- btnText [input]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Teaser\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByText($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByColorLeft($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByColorRight($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByImage($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getBySnippet($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByBtnText($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Teaser extends Concrete
{
protected $o_classId = "Teaser";
protected $o_className = "Teaser";
protected $Title;
protected $text;
protected $colorLeft;
protected $colorRight;
protected $Image;
protected $snippet;
protected $btnText;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Teaser
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get Title - Überschrift
* @return string|null
*/
public function getTitle(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Title");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->Title;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set Title - Überschrift
* @param string|null $Title
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setTitle(?string $Title)
{
$this->Title = $Title;
return $this;
}
/**
* Get text - Einleitung
* @return string|null
*/
public function getText(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("text");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->text;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set text - Einleitung
* @param string|null $text
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setText(?string $text)
{
$this->text = $text;
return $this;
}
/**
* Get colorLeft - Farbe Links
* @return string|null
*/
public function getColorLeft(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("colorLeft");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->colorLeft;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set colorLeft - Farbe Links
* @param string|null $colorLeft
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setColorLeft(?string $colorLeft)
{
$this->colorLeft = $colorLeft;
return $this;
}
/**
* Get colorRight - Farbe Rechts
* @return string|null
*/
public function getColorRight(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("colorRight");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->colorRight;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set colorRight - Farbe Rechts
* @param string|null $colorRight
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setColorRight(?string $colorRight)
{
$this->colorRight = $colorRight;
return $this;
}
/**
* 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\Teaser
*/
public function setImage(?\Pimcore\Model\Asset\Image $Image)
{
$this->Image = $Image;
return $this;
}
/**
* Get snippet - snippet
* @return \Pimcore\Model\Document\Snippet|null
*/
public function getSnippet(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("snippet");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("snippet")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set snippet - snippet
* @param \Pimcore\Model\Document\Snippet $snippet
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setSnippet(?\Pimcore\Model\Element\AbstractElement $snippet)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("snippet");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getSnippet();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $snippet);
if (!$isEqual) {
$this->markFieldDirty("snippet", true);
}
$this->snippet = $fd->preSetData($this, $snippet);
return $this;
}
/**
* Get btnText - Button
* @return string|null
*/
public function getBtnText(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("btnText");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->btnText;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set btnText - Button
* @param string|null $btnText
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setBtnText(?string $btnText)
{
$this->btnText = $btnText;
return $this;
}
}