<?php
/**
* Inheritance: no
* Variants: no
* Een Property ofwel eigenschap wordt gebruikt ter ondersteuning van het invoeren van product eigenschappen. Bijvoorbeeld bij het aanvullen van de diverse product-eigenschappen welke samengevat worden bij een product categorie.
*
* Fields Summary:
* - publicly_visible [checkbox]
* - localizedfields [localizedfields]
* -- title [input]
* -- description [textarea]
* -- remark [textarea]
* - unit [select]
* - setoptions [textarea]
* - specification_channels [multiselect]
* - icon [image]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Property\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByPublicly_visible($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByRemark($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByUnit($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getBySetoptions($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getBySpecification_channels($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByIcon($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Property extends Concrete
{
protected $o_classId = "8";
protected $o_className = "Property";
protected $publicly_visible;
protected $localizedfields;
protected $unit;
protected $setoptions;
protected $specification_channels;
protected $icon;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Property
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get publicly_visible - Publicly visible
* @return bool|null
*/
public function getPublicly_visible(): ?bool
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("publicly_visible");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->publicly_visible;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set publicly_visible - Publicly visible
* @param bool|null $publicly_visible
* @return \Pimcore\Model\DataObject\Property
*/
public function setPublicly_visible(?bool $publicly_visible)
{
$this->publicly_visible = $publicly_visible;
return $this;
}
/**
* Get localizedfields - Vertaalbare velden
* @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 title - Eigenschap naam
* @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 description - Beschrijving
* @return string|null
*/
public function getDescription($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("description", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("description");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get remark - Standaard kanttekening
* @return string|null
*/
public function getRemark($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("remark", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("remark");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set localizedfields - Vertaalbare velden
* @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
* @return \Pimcore\Model\DataObject\Property
*/
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 title - Eigenschap naam
* @param string|null $title
* @return \Pimcore\Model\DataObject\Property
*/
public function setTitle (?string $title, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("title", $title, $language, !$isEqual);
return $this;
}
/**
* Set description - Beschrijving
* @param string|null $description
* @return \Pimcore\Model\DataObject\Property
*/
public function setDescription (?string $description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("description", $description, $language, !$isEqual);
return $this;
}
/**
* Set remark - Standaard kanttekening
* @param string|null $remark
* @return \Pimcore\Model\DataObject\Property
*/
public function setRemark (?string $remark, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("remark", $remark, $language, !$isEqual);
return $this;
}
/**
* Get unit - Eenheid
* @return string|null
*/
public function getUnit(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("unit");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->unit;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set unit - Eenheid
* @param string|null $unit
* @return \Pimcore\Model\DataObject\Property
*/
public function setUnit(?string $unit)
{
$this->unit = $unit;
return $this;
}
/**
* Get setoptions - Set Opties
* @return string|null
*/
public function getSetoptions(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("setoptions");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->setoptions;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set setoptions - Set Opties
* @param string|null $setoptions
* @return \Pimcore\Model\DataObject\Property
*/
public function setSetoptions(?string $setoptions)
{
$this->setoptions = $setoptions;
return $this;
}
/**
* Get specification_channels - Kanalen
* @return string[]|null
*/
public function getSpecification_channels(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("specification_channels");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->specification_channels;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set specification_channels - Kanalen
* @param string[]|null $specification_channels
* @return \Pimcore\Model\DataObject\Property
*/
public function setSpecification_channels(?array $specification_channels)
{
$this->specification_channels = $specification_channels;
return $this;
}
/**
* Get icon - Icoon
* @return \Pimcore\Model\Asset\Image|null
*/
public function getIcon(): ?\Pimcore\Model\Asset\Image
{
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 - Icoon
* @param \Pimcore\Model\Asset\Image|null $icon
* @return \Pimcore\Model\DataObject\Property
*/
public function setIcon(?\Pimcore\Model\Asset\Image $icon)
{
$this->icon = $icon;
return $this;
}
}