<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - headerTag [select]
* - localizedfields [localizedfields]
* -- Subtitle [input]
* -- Title [wysiwyg]
* -- Text [wysiwyg]
* -- Link [link]
* -- badge_price [input]
* -- badge_text [input]
* - linkAsButton [checkbox]
* - Image [image]
* - Video [video]
*/
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 getByHeaderTag($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getBySubtitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByText($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByLink($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByBadge_price($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByBadge_text($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByLinkAsButton($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)
*/
class Teaser extends Concrete
{
protected $o_classId = "CNTEASER";
protected $o_className = "Teaser";
protected $headerTag;
protected $localizedfields;
protected $linkAsButton;
protected $Image;
protected $Video;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Teaser
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get headerTag - Header Tag
* @return string|null
*/
public function getHeaderTag(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("headerTag");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->headerTag;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set headerTag - Header Tag
* @param string|null $headerTag
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setHeaderTag(?string $headerTag)
{
$this->headerTag = $headerTag;
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 Subtitle - Subtitel
* @return string|null
*/
public function getSubtitle($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("Subtitle", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Subtitle");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get Title - Titel
* @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 Text - Text
* @return string|null
*/
public function getText($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("Text", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Text");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get Link - Link
* @return \Pimcore\Model\DataObject\Data\Link|null
*/
public function getLink($language = null): ?\Pimcore\Model\DataObject\Data\Link
{
$data = $this->getLocalizedfields()->getLocalizedValue("Link", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Link");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get badge_price - Preis des Badges
* @return string|null
*/
public function getBadge_price($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("badge_price", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("badge_price");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get badge_text - Text für Badge
* @return string|null
*/
public function getBadge_text($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("badge_text", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("badge_text");
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\Teaser
*/
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 Subtitle - Subtitel
* @param string|null $Subtitle
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setSubtitle (?string $Subtitle, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("Subtitle", $Subtitle, $language, !$isEqual);
return $this;
}
/**
* Set Title - Titel
* @param string|null $Title
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setTitle (?string $Title, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("Title", $Title, $language, !$isEqual);
return $this;
}
/**
* Set Text - Text
* @param string|null $Text
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setText (?string $Text, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("Text", $Text, $language, !$isEqual);
return $this;
}
/**
* Set Link - Link
* @param \Pimcore\Model\DataObject\Data\Link|null $Link
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setLink (?\Pimcore\Model\DataObject\Data\Link $Link, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("Link", $Link, $language, !$isEqual);
return $this;
}
/**
* Set badge_price - Preis des Badges
* @param string|null $badge_price
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setBadge_price (?string $badge_price, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("badge_price", $badge_price, $language, !$isEqual);
return $this;
}
/**
* Set badge_text - Text für Badge
* @param string|null $badge_text
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setBadge_text (?string $badge_text, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("badge_text", $badge_text, $language, !$isEqual);
return $this;
}
/**
* Get linkAsButton - Link als Button
* @return bool|null
*/
public function getLinkAsButton(): ?bool
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("linkAsButton");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->linkAsButton;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set linkAsButton - Link als Button
* @param bool|null $linkAsButton
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setLinkAsButton(?bool $linkAsButton)
{
$this->linkAsButton = $linkAsButton;
return $this;
}
/**
* Get Image - Bild
* @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 - Bild
* @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 Video - Video
* @return \Pimcore\Model\DataObject\Data\Video|null
*/
public function getVideo(): ?\Pimcore\Model\DataObject\Data\Video
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Video");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->Video;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set Video - Video
* @param \Pimcore\Model\DataObject\Data\Video|null $Video
* @return \Pimcore\Model\DataObject\Teaser
*/
public function setVideo(?\Pimcore\Model\DataObject\Data\Video $Video)
{
$this->Video = $Video;
return $this;
}
}