<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - icon [select]
* - localizedfields [localizedfields]
* -- textBold [select]
* -- title [input]
* -- subTitle [input]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\USP\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\USP\Listing|\Pimcore\Model\DataObject\USP|null getByIcon($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\USP\Listing|\Pimcore\Model\DataObject\USP|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\USP\Listing|\Pimcore\Model\DataObject\USP|null getByTextBold($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\USP\Listing|\Pimcore\Model\DataObject\USP|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\USP\Listing|\Pimcore\Model\DataObject\USP|null getBySubTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
*/
class USP extends Concrete
{
protected $o_classId = "USP";
protected $o_className = "USP";
protected $icon;
protected $localizedfields;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\USP
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get icon - Icon
* @return string|null
*/
public function getIcon(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("icon");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->icon;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set icon - Icon
* @param string|null $icon
* @return \Pimcore\Model\DataObject\USP
*/
public function setIcon(?string $icon)
{
$this->icon = $icon;
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 textBold - Bold
* @return string|null
*/
public function getTextBold($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("textBold", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("textBold");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get title - Title
* @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 subTitle - Subtitle
* @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;
}
/**
* Set localizedfields -
* @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
* @return \Pimcore\Model\DataObject\USP
*/
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 textBold - Bold
* @param string|null $textBold
* @return \Pimcore\Model\DataObject\USP
*/
public function setTextBold (?string $textBold, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("textBold", $textBold, $language, !$isEqual);
return $this;
}
/**
* Set title - Title
* @param string|null $title
* @return \Pimcore\Model\DataObject\USP
*/
public function setTitle (?string $title, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("title", $title, $language, !$isEqual);
return $this;
}
/**
* Set subTitle - Subtitle
* @param string|null $subTitle
* @return \Pimcore\Model\DataObject\USP
*/
public function setSubTitle (?string $subTitle, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("subTitle", $subTitle, $language, !$isEqual);
return $this;
}
}