var/classes/DataObject/BrandExtension.php line 185

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: yes
  4.  * Variants: yes
  5.  *
  6.  * Fields Summary:
  7.  * - localizedfields [localizedfields]
  8.  * -- Name [input]
  9.  * -- Content [input]
  10.  * -- Description [wysiwyg]
  11.  * -- VideoList [manyToManyRelation]
  12.  * -- DocumentList [manyToManyRelation]
  13.  * - Category [advancedManyToManyObjectRelation]
  14.  * - Brand [advancedManyToManyObjectRelation]
  15.  * - CountryAvailabilityList [advancedManyToManyObjectRelation]
  16.  * - bottleSize [select]
  17.  * - DocumentImage [image]
  18.  * - images [imageGallery]
  19.  */
  20. namespace Pimcore\Model\DataObject;
  21. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  22. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  23. /**
  24. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing getList(array $config = [])
  25. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByContent($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByVideoList($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByDocumentList($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByBrand($value, $limit = 0, $offset = 0, $objectTypes = null)
  33. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByCountryAvailabilityList($value, $limit = 0, $offset = 0, $objectTypes = null)
  34. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByBottleSize($value, $limit = 0, $offset = 0, $objectTypes = null)
  35. * @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByDocumentImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  36. */
  37. class BrandExtension extends \Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractProduct
  38. {
  39. protected $o_classId "32";
  40. protected $o_className "BrandExtension";
  41. protected $localizedfields;
  42. protected $Category;
  43. protected $Brand;
  44. protected $CountryAvailabilityList;
  45. protected $bottleSize;
  46. protected $DocumentImage;
  47. protected $images;
  48. /**
  49. * @param array $values
  50. * @return \Pimcore\Model\DataObject\BrandExtension
  51. */
  52. public static function create($values = array()) {
  53.     $object = new static();
  54.     $object->setValues($values);
  55.     return $object;
  56. }
  57. /**
  58. * Get localizedfields - 
  59. * @return \Pimcore\Model\DataObject\Localizedfield|null
  60. */
  61. public function getLocalizedfields()
  62. {
  63.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  64.         $preValue $this->preGetValue("localizedfields");
  65.         if ($preValue !== null) {
  66.             return $preValue;
  67.         }
  68.     }
  69.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  70.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("localizedfields")->isEmpty($data)) {
  71.         try {
  72.             return $this->getValueFromParent("localizedfields");
  73.         } catch (InheritanceParentNotFoundException $e) {
  74.             // no data from parent available, continue ...
  75.         }
  76.     }
  77.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  78.         return $data->getPlain();
  79.     }
  80.     return $data;
  81. }
  82. /**
  83. * Get Name - Name
  84. * @return string|null
  85. */
  86. public function getName($language null)
  87. {
  88.     $data $this->getLocalizedfields()->getLocalizedValue("Name"$language);
  89.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  90.         $preValue $this->preGetValue("Name");
  91.         if ($preValue !== null) {
  92.             return $preValue;
  93.         }
  94.     }
  95.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  96.         return $data->getPlain();
  97.     }
  98.     return $data;
  99. }
  100. /**
  101. * Get Content - Content
  102. * @return string|null
  103. */
  104. public function getContent($language null)
  105. {
  106.     $data $this->getLocalizedfields()->getLocalizedValue("Content"$language);
  107.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  108.         $preValue $this->preGetValue("Content");
  109.         if ($preValue !== null) {
  110.             return $preValue;
  111.         }
  112.     }
  113.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  114.         return $data->getPlain();
  115.     }
  116.     return $data;
  117. }
  118. /**
  119. * Get Description - Description
  120. * @return string|null
  121. */
  122. public function getDescription($language null)
  123. {
  124.     $data $this->getLocalizedfields()->getLocalizedValue("Description"$language);
  125.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  126.         $preValue $this->preGetValue("Description");
  127.         if ($preValue !== null) {
  128.             return $preValue;
  129.         }
  130.     }
  131.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  132.         return $data->getPlain();
  133.     }
  134.     return $data;
  135. }
  136. /**
  137. * Get VideoList - Video List
  138. * @return \Pimcore\Model\Asset\Video[]
  139. */
  140. public function getVideoList($language null)
  141. {
  142.     $data $this->getLocalizedfields()->getLocalizedValue("VideoList"$language);
  143.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  144.         $preValue $this->preGetValue("VideoList");
  145.         if ($preValue !== null) {
  146.             return $preValue;
  147.         }
  148.     }
  149.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  150.         return $data->getPlain();
  151.     }
  152.     return $data;
  153. }
  154. /**
  155. * Get DocumentList - Document List
  156. * @return \Pimcore\Model\Asset\Folder[] | \Pimcore\Model\Asset\Image[] | \Pimcore\Model\Asset\Text[] | \Pimcore\Model\Asset\Audio[] | \Pimcore\Model\Asset\Unknown[] | \Pimcore\Model\Asset\Document[] | \Pimcore\Model\Asset\Archive[]
  157. */
  158. public function getDocumentList($language null)
  159. {
  160.     $data $this->getLocalizedfields()->getLocalizedValue("DocumentList"$language);
  161.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  162.         $preValue $this->preGetValue("DocumentList");
  163.         if ($preValue !== null) {
  164.             return $preValue;
  165.         }
  166.     }
  167.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  168.         return $data->getPlain();
  169.     }
  170.     return $data;
  171. }
  172. /**
  173. * Set localizedfields - 
  174. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  175. * @return \Pimcore\Model\DataObject\BrandExtension
  176. */
  177. public function setLocalizedfields($localizedfields)
  178. {
  179.     $inheritValues self::getGetInheritedValues();
  180.     self::setGetInheritedValues(false);
  181.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  182.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  183.     $currentData $this->getLocalizedfields();
  184.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  185.     self::setGetInheritedValues($inheritValues);
  186.     $this->markFieldDirty("localizedfields"true);
  187.     $this->localizedfields $localizedfields;
  188.     return $this;
  189. }
  190. /**
  191. * Set Name - Name
  192. * @param string|null $Name
  193. * @return \Pimcore\Model\DataObject\BrandExtension
  194. */
  195. public function setName ($Name$language null)
  196. {
  197.     $isEqual false;
  198.     $this->getLocalizedfields()->setLocalizedValue("Name"$Name$language, !$isEqual);
  199.     return $this;
  200. }
  201. /**
  202. * Set Content - Content
  203. * @param string|null $Content
  204. * @return \Pimcore\Model\DataObject\BrandExtension
  205. */
  206. public function setContent ($Content$language null)
  207. {
  208.     $isEqual false;
  209.     $this->getLocalizedfields()->setLocalizedValue("Content"$Content$language, !$isEqual);
  210.     return $this;
  211. }
  212. /**
  213. * Set Description - Description
  214. * @param string|null $Description
  215. * @return \Pimcore\Model\DataObject\BrandExtension
  216. */
  217. public function setDescription ($Description$language null)
  218. {
  219.     $isEqual false;
  220.     $this->getLocalizedfields()->setLocalizedValue("Description"$Description$language, !$isEqual);
  221.     return $this;
  222. }
  223. /**
  224. * Set VideoList - Video List
  225. * @param \Pimcore\Model\Asset\Video[] $VideoList
  226. * @return \Pimcore\Model\DataObject\BrandExtension
  227. */
  228. public function setVideoList ($VideoList$language null)
  229. {
  230.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("VideoList");
  231.     $inheritValues self::getGetInheritedValues();
  232.     self::setGetInheritedValues(false);
  233.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  234.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  235.     $currentData $this->getVideoList($language);
  236.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  237.     self::setGetInheritedValues($inheritValues);
  238.     $isEqual $fd->isEqual($currentData$VideoList);
  239.     if (!$isEqual) {
  240.         $this->markFieldDirty("VideoList"true);
  241.     }
  242.     $this->getLocalizedfields()->setLocalizedValue("VideoList"$VideoList$language, !$isEqual);
  243.     return $this;
  244. }
  245. /**
  246. * Set DocumentList - Document List
  247. * @param \Pimcore\Model\Asset\Folder[] | \Pimcore\Model\Asset\Image[] | \Pimcore\Model\Asset\Text[] | \Pimcore\Model\Asset\Audio[] | \Pimcore\Model\Asset\Unknown[] | \Pimcore\Model\Asset\Document[] | \Pimcore\Model\Asset\Archive[] $DocumentList
  248. * @return \Pimcore\Model\DataObject\BrandExtension
  249. */
  250. public function setDocumentList ($DocumentList$language null)
  251. {
  252.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("DocumentList");
  253.     $inheritValues self::getGetInheritedValues();
  254.     self::setGetInheritedValues(false);
  255.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  256.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  257.     $currentData $this->getDocumentList($language);
  258.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  259.     self::setGetInheritedValues($inheritValues);
  260.     $isEqual $fd->isEqual($currentData$DocumentList);
  261.     if (!$isEqual) {
  262.         $this->markFieldDirty("DocumentList"true);
  263.     }
  264.     $this->getLocalizedfields()->setLocalizedValue("DocumentList"$DocumentList$language, !$isEqual);
  265.     return $this;
  266. }
  267. /**
  268. * Get Category - Category
  269. * @return \Pimcore\Model\DataObject\Data\ObjectMetadata[]
  270. */
  271. public function getCategory()
  272. {
  273.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  274.         $preValue $this->preGetValue("Category");
  275.         if ($preValue !== null) {
  276.             return $preValue;
  277.         }
  278.     }
  279.     $data $this->getClass()->getFieldDefinition("Category")->preGetData($this);
  280.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Category")->isEmpty($data)) {
  281.         try {
  282.             return $this->getValueFromParent("Category");
  283.         } catch (InheritanceParentNotFoundException $e) {
  284.             // no data from parent available, continue ...
  285.         }
  286.     }
  287.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  288.         return $data->getPlain();
  289.     }
  290.     return $data;
  291. }
  292. /**
  293. * Set Category - Category
  294. * @param \Pimcore\Model\DataObject\Data\ObjectMetadata[] $Category
  295. * @return \Pimcore\Model\DataObject\BrandExtension
  296. */
  297. public function setCategory($Category)
  298. {
  299.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\AdvancedManyToManyObjectRelation $fd */
  300.     $fd $this->getClass()->getFieldDefinition("Category");
  301.     $inheritValues self::getGetInheritedValues();
  302.     self::setGetInheritedValues(false);
  303.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  304.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  305.     $currentData $this->getCategory();
  306.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  307.     self::setGetInheritedValues($inheritValues);
  308.     $isEqual $fd->isEqual($currentData$Category);
  309.     if (!$isEqual) {
  310.         $this->markFieldDirty("Category"true);
  311.     }
  312.     $this->Category $fd->preSetData($this$Category);
  313.     return $this;
  314. }
  315. /**
  316. * Get Brand - Item Type
  317. * @return \Pimcore\Model\DataObject\Data\ObjectMetadata[]
  318. */
  319. public function getBrand()
  320. {
  321.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  322.         $preValue $this->preGetValue("Brand");
  323.         if ($preValue !== null) {
  324.             return $preValue;
  325.         }
  326.     }
  327.     $data $this->getClass()->getFieldDefinition("Brand")->preGetData($this);
  328.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Brand")->isEmpty($data)) {
  329.         try {
  330.             return $this->getValueFromParent("Brand");
  331.         } catch (InheritanceParentNotFoundException $e) {
  332.             // no data from parent available, continue ...
  333.         }
  334.     }
  335.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  336.         return $data->getPlain();
  337.     }
  338.     return $data;
  339. }
  340. /**
  341. * Set Brand - Item Type
  342. * @param \Pimcore\Model\DataObject\Data\ObjectMetadata[] $Brand
  343. * @return \Pimcore\Model\DataObject\BrandExtension
  344. */
  345. public function setBrand($Brand)
  346. {
  347.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\AdvancedManyToManyObjectRelation $fd */
  348.     $fd $this->getClass()->getFieldDefinition("Brand");
  349.     $inheritValues self::getGetInheritedValues();
  350.     self::setGetInheritedValues(false);
  351.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  352.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  353.     $currentData $this->getBrand();
  354.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  355.     self::setGetInheritedValues($inheritValues);
  356.     $isEqual $fd->isEqual($currentData$Brand);
  357.     if (!$isEqual) {
  358.         $this->markFieldDirty("Brand"true);
  359.     }
  360.     $this->Brand $fd->preSetData($this$Brand);
  361.     return $this;
  362. }
  363. /**
  364. * Get CountryAvailabilityList - Country Availability List
  365. * @return \Pimcore\Model\DataObject\Data\ObjectMetadata[]
  366. */
  367. public function getCountryAvailabilityList()
  368. {
  369.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  370.         $preValue $this->preGetValue("CountryAvailabilityList");
  371.         if ($preValue !== null) {
  372.             return $preValue;
  373.         }
  374.     }
  375.     $data $this->getClass()->getFieldDefinition("CountryAvailabilityList")->preGetData($this);
  376.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("CountryAvailabilityList")->isEmpty($data)) {
  377.         try {
  378.             return $this->getValueFromParent("CountryAvailabilityList");
  379.         } catch (InheritanceParentNotFoundException $e) {
  380.             // no data from parent available, continue ...
  381.         }
  382.     }
  383.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  384.         return $data->getPlain();
  385.     }
  386.     return $data;
  387. }
  388. /**
  389. * Set CountryAvailabilityList - Country Availability List
  390. * @param \Pimcore\Model\DataObject\Data\ObjectMetadata[] $CountryAvailabilityList
  391. * @return \Pimcore\Model\DataObject\BrandExtension
  392. */
  393. public function setCountryAvailabilityList($CountryAvailabilityList)
  394. {
  395.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\AdvancedManyToManyObjectRelation $fd */
  396.     $fd $this->getClass()->getFieldDefinition("CountryAvailabilityList");
  397.     $inheritValues self::getGetInheritedValues();
  398.     self::setGetInheritedValues(false);
  399.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  400.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  401.     $currentData $this->getCountryAvailabilityList();
  402.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  403.     self::setGetInheritedValues($inheritValues);
  404.     $isEqual $fd->isEqual($currentData$CountryAvailabilityList);
  405.     if (!$isEqual) {
  406.         $this->markFieldDirty("CountryAvailabilityList"true);
  407.     }
  408.     $this->CountryAvailabilityList $fd->preSetData($this$CountryAvailabilityList);
  409.     return $this;
  410. }
  411. /**
  412. * Get bottleSize - Bottle Photo
  413. * @return string|null
  414. */
  415. public function getBottleSize()
  416. {
  417.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  418.         $preValue $this->preGetValue("bottleSize");
  419.         if ($preValue !== null) {
  420.             return $preValue;
  421.         }
  422.     }
  423.     $data $this->bottleSize;
  424.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("bottleSize")->isEmpty($data)) {
  425.         try {
  426.             return $this->getValueFromParent("bottleSize");
  427.         } catch (InheritanceParentNotFoundException $e) {
  428.             // no data from parent available, continue ...
  429.         }
  430.     }
  431.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  432.         return $data->getPlain();
  433.     }
  434.     return $data;
  435. }
  436. /**
  437. * Set bottleSize - Bottle Photo
  438. * @param string|null $bottleSize
  439. * @return \Pimcore\Model\DataObject\BrandExtension
  440. */
  441. public function setBottleSize($bottleSize)
  442. {
  443.     $this->bottleSize $bottleSize;
  444.     return $this;
  445. }
  446. /**
  447. * Get DocumentImage - DocumentImage
  448. * @return \Pimcore\Model\Asset\Image|null
  449. */
  450. public function getDocumentImage()
  451. {
  452.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  453.         $preValue $this->preGetValue("DocumentImage");
  454.         if ($preValue !== null) {
  455.             return $preValue;
  456.         }
  457.     }
  458.     $data $this->DocumentImage;
  459.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("DocumentImage")->isEmpty($data)) {
  460.         try {
  461.             return $this->getValueFromParent("DocumentImage");
  462.         } catch (InheritanceParentNotFoundException $e) {
  463.             // no data from parent available, continue ...
  464.         }
  465.     }
  466.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  467.         return $data->getPlain();
  468.     }
  469.     return $data;
  470. }
  471. /**
  472. * Set DocumentImage - DocumentImage
  473. * @param \Pimcore\Model\Asset\Image|null $DocumentImage
  474. * @return \Pimcore\Model\DataObject\BrandExtension
  475. */
  476. public function setDocumentImage($DocumentImage)
  477. {
  478.     $this->DocumentImage $DocumentImage;
  479.     return $this;
  480. }
  481. /**
  482. * Get images - Images
  483. * @return \Pimcore\Model\DataObject\Data\ImageGallery|null
  484. */
  485. public function getImages()
  486. {
  487.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  488.         $preValue $this->preGetValue("images");
  489.         if ($preValue !== null) {
  490.             return $preValue;
  491.         }
  492.     }
  493.     $data $this->images;
  494.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("images")->isEmpty($data)) {
  495.         try {
  496.             return $this->getValueFromParent("images");
  497.         } catch (InheritanceParentNotFoundException $e) {
  498.             // no data from parent available, continue ...
  499.         }
  500.     }
  501.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  502.         return $data->getPlain();
  503.     }
  504.     return $data;
  505. }
  506. /**
  507. * Set images - Images
  508. * @param \Pimcore\Model\DataObject\Data\ImageGallery|null $images
  509. * @return \Pimcore\Model\DataObject\BrandExtension
  510. */
  511. public function setImages($images)
  512. {
  513.     $this->images $images;
  514.     return $this;
  515. }
  516. }