var/classes/DataObject/Property.php line 38

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  * 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.
  6.  *
  7.  * Fields Summary:
  8.  * - publicly_visible [checkbox]
  9.  * - localizedfields [localizedfields]
  10.  * -- title [input]
  11.  * -- description [textarea]
  12.  * -- remark [textarea]
  13.  * - unit [select]
  14.  * - setoptions [textarea]
  15.  * - specification_channels [multiselect]
  16.  * - icon [image]
  17.  */
  18. namespace Pimcore\Model\DataObject;
  19. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  20. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  21. /**
  22. * @method static \Pimcore\Model\DataObject\Property\Listing getList(array $config = [])
  23. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByPublicly_visible($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByRemark($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByUnit($value, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getBySetoptions($value, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getBySpecification_channels($value, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\Property\Listing|\Pimcore\Model\DataObject\Property|null getByIcon($value, $limit = 0, $offset = 0, $objectTypes = null)
  32. */
  33. class Property extends Concrete
  34. {
  35. protected $o_classId "8";
  36. protected $o_className "Property";
  37. protected $publicly_visible;
  38. protected $localizedfields;
  39. protected $unit;
  40. protected $setoptions;
  41. protected $specification_channels;
  42. protected $icon;
  43. /**
  44. * @param array $values
  45. * @return \Pimcore\Model\DataObject\Property
  46. */
  47. public static function create($values = array()) {
  48.     $object = new static();
  49.     $object->setValues($values);
  50.     return $object;
  51. }
  52. /**
  53. * Get publicly_visible - Publicly visible
  54. * @return bool|null
  55. */
  56. public function getPublicly_visible(): ?bool
  57. {
  58.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  59.         $preValue $this->preGetValue("publicly_visible");
  60.         if ($preValue !== null) {
  61.             return $preValue;
  62.         }
  63.     }
  64.     $data $this->publicly_visible;
  65.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  66.         return $data->getPlain();
  67.     }
  68.     return $data;
  69. }
  70. /**
  71. * Set publicly_visible - Publicly visible
  72. * @param bool|null $publicly_visible
  73. * @return \Pimcore\Model\DataObject\Property
  74. */
  75. public function setPublicly_visible(?bool $publicly_visible)
  76. {
  77.     $this->publicly_visible $publicly_visible;
  78.     return $this;
  79. }
  80. /**
  81. * Get localizedfields - Vertaalbare velden
  82. * @return \Pimcore\Model\DataObject\Localizedfield|null
  83. */
  84. public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
  85. {
  86.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  87.         $preValue $this->preGetValue("localizedfields");
  88.         if ($preValue !== null) {
  89.             return $preValue;
  90.         }
  91.     }
  92.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  93.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  94.         return $data->getPlain();
  95.     }
  96.     return $data;
  97. }
  98. /**
  99. * Get title - Eigenschap naam
  100. * @return string|null
  101. */
  102. public function getTitle($language null): ?string
  103. {
  104.     $data $this->getLocalizedfields()->getLocalizedValue("title"$language);
  105.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  106.         $preValue $this->preGetValue("title");
  107.         if ($preValue !== null) {
  108.             return $preValue;
  109.         }
  110.     }
  111.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  112.         return $data->getPlain();
  113.     }
  114.     return $data;
  115. }
  116. /**
  117. * Get description - Beschrijving
  118. * @return string|null
  119. */
  120. public function getDescription($language null): ?string
  121. {
  122.     $data $this->getLocalizedfields()->getLocalizedValue("description"$language);
  123.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  124.         $preValue $this->preGetValue("description");
  125.         if ($preValue !== null) {
  126.             return $preValue;
  127.         }
  128.     }
  129.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  130.         return $data->getPlain();
  131.     }
  132.     return $data;
  133. }
  134. /**
  135. * Get remark - Standaard kanttekening
  136. * @return string|null
  137. */
  138. public function getRemark($language null): ?string
  139. {
  140.     $data $this->getLocalizedfields()->getLocalizedValue("remark"$language);
  141.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  142.         $preValue $this->preGetValue("remark");
  143.         if ($preValue !== null) {
  144.             return $preValue;
  145.         }
  146.     }
  147.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  148.         return $data->getPlain();
  149.     }
  150.     return $data;
  151. }
  152. /**
  153. * Set localizedfields - Vertaalbare velden
  154. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  155. * @return \Pimcore\Model\DataObject\Property
  156. */
  157. public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
  158. {
  159.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  160.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  161.     $currentData $this->getLocalizedfields();
  162.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  163.     $this->markFieldDirty("localizedfields"true);
  164.     $this->localizedfields $localizedfields;
  165.     return $this;
  166. }
  167. /**
  168. * Set title - Eigenschap naam
  169. * @param string|null $title
  170. * @return \Pimcore\Model\DataObject\Property
  171. */
  172. public function setTitle (?string $title$language null)
  173. {
  174.     $isEqual false;
  175.     $this->getLocalizedfields()->setLocalizedValue("title"$title$language, !$isEqual);
  176.     return $this;
  177. }
  178. /**
  179. * Set description - Beschrijving
  180. * @param string|null $description
  181. * @return \Pimcore\Model\DataObject\Property
  182. */
  183. public function setDescription (?string $description$language null)
  184. {
  185.     $isEqual false;
  186.     $this->getLocalizedfields()->setLocalizedValue("description"$description$language, !$isEqual);
  187.     return $this;
  188. }
  189. /**
  190. * Set remark - Standaard kanttekening
  191. * @param string|null $remark
  192. * @return \Pimcore\Model\DataObject\Property
  193. */
  194. public function setRemark (?string $remark$language null)
  195. {
  196.     $isEqual false;
  197.     $this->getLocalizedfields()->setLocalizedValue("remark"$remark$language, !$isEqual);
  198.     return $this;
  199. }
  200. /**
  201. * Get unit - Eenheid
  202. * @return string|null
  203. */
  204. public function getUnit(): ?string
  205. {
  206.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  207.         $preValue $this->preGetValue("unit");
  208.         if ($preValue !== null) {
  209.             return $preValue;
  210.         }
  211.     }
  212.     $data $this->unit;
  213.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  214.         return $data->getPlain();
  215.     }
  216.     return $data;
  217. }
  218. /**
  219. * Set unit - Eenheid
  220. * @param string|null $unit
  221. * @return \Pimcore\Model\DataObject\Property
  222. */
  223. public function setUnit(?string $unit)
  224. {
  225.     $this->unit $unit;
  226.     return $this;
  227. }
  228. /**
  229. * Get setoptions - Set Opties
  230. * @return string|null
  231. */
  232. public function getSetoptions(): ?string
  233. {
  234.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  235.         $preValue $this->preGetValue("setoptions");
  236.         if ($preValue !== null) {
  237.             return $preValue;
  238.         }
  239.     }
  240.     $data $this->setoptions;
  241.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  242.         return $data->getPlain();
  243.     }
  244.     return $data;
  245. }
  246. /**
  247. * Set setoptions - Set Opties
  248. * @param string|null $setoptions
  249. * @return \Pimcore\Model\DataObject\Property
  250. */
  251. public function setSetoptions(?string $setoptions)
  252. {
  253.     $this->setoptions $setoptions;
  254.     return $this;
  255. }
  256. /**
  257. * Get specification_channels - Kanalen
  258. * @return string[]|null
  259. */
  260. public function getSpecification_channels(): ?array
  261. {
  262.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  263.         $preValue $this->preGetValue("specification_channels");
  264.         if ($preValue !== null) {
  265.             return $preValue;
  266.         }
  267.     }
  268.     $data $this->specification_channels;
  269.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  270.         return $data->getPlain();
  271.     }
  272.     return $data;
  273. }
  274. /**
  275. * Set specification_channels - Kanalen
  276. * @param string[]|null $specification_channels
  277. * @return \Pimcore\Model\DataObject\Property
  278. */
  279. public function setSpecification_channels(?array $specification_channels)
  280. {
  281.     $this->specification_channels $specification_channels;
  282.     return $this;
  283. }
  284. /**
  285. * Get icon - Icoon
  286. * @return \Pimcore\Model\Asset\Image|null
  287. */
  288. public function getIcon(): ?\Pimcore\Model\Asset\Image
  289. {
  290.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  291.         $preValue $this->preGetValue("icon");
  292.         if ($preValue !== null) {
  293.             return $preValue;
  294.         }
  295.     }
  296.     $data $this->icon;
  297.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  298.         return $data->getPlain();
  299.     }
  300.     return $data;
  301. }
  302. /**
  303. * Set icon - Icoon
  304. * @param \Pimcore\Model\Asset\Image|null $icon
  305. * @return \Pimcore\Model\DataObject\Property
  306. */
  307. public function setIcon(?\Pimcore\Model\Asset\Image $icon)
  308. {
  309.     $this->icon $icon;
  310.     return $this;
  311. }
  312. }