<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - localizedfields [localizedfields]
* -- name [input]
* -- logo [image]
* -- linktext [input]
* -- website [manyToOneRelation]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Zertifikat\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Zertifikat\Listing|\Pimcore\Model\DataObject\Zertifikat|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Zertifikat\Listing|\Pimcore\Model\DataObject\Zertifikat|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Zertifikat\Listing|\Pimcore\Model\DataObject\Zertifikat|null getByLogo($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Zertifikat\Listing|\Pimcore\Model\DataObject\Zertifikat|null getByLinktext($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Zertifikat\Listing|\Pimcore\Model\DataObject\Zertifikat|null getByWebsite($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Zertifikat extends Concrete
{
protected $o_classId = "17";
protected $o_className = "Zertifikat";
protected $localizedfields;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Zertifikat
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get localizedfields -
* @return \Pimcore\Model\DataObject\Localizedfield|null
*/
public function getLocalizedfields()
{
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)
{
$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 logo - logo
* @return \Pimcore\Model\Asset\Image|null
*/
public function getLogo($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("logo", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("logo");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get linktext - linktext
* @return string|null
*/
public function getLinktext($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("linktext", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("linktext");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get website - website
* @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link|null
*/
public function getWebsite($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("website", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("website");
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\Zertifikat
*/
public function setLocalizedfields($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\Zertifikat
*/
public function setName ($name, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("name", $name, $language, !$isEqual);
return $this;
}
/**
* Set logo - logo
* @param \Pimcore\Model\Asset\Image|null $logo
* @return \Pimcore\Model\DataObject\Zertifikat
*/
public function setLogo ($logo, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("logo", $logo, $language, !$isEqual);
return $this;
}
/**
* Set linktext - linktext
* @param string|null $linktext
* @return \Pimcore\Model\DataObject\Zertifikat
*/
public function setLinktext ($linktext, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("linktext", $linktext, $language, !$isEqual);
return $this;
}
/**
* Set website - website
* @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link|null $website
* @return \Pimcore\Model\DataObject\Zertifikat
*/
public function setWebsite ($website, $language = null)
{
$fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("website");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getWebsite($language);
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $website);
if (!$isEqual) {
$this->markFieldDirty("website", true);
}
$this->getLocalizedfields()->setLocalizedValue("website", $website, $language, !$isEqual);
return $this;
}
}