var/classes/DataObject/Configset.php line 41

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - localizedfields [localizedfields]
  8.  * -- languagefolder [manyToOneRelation]
  9.  * -- navstartnodeid [manyToOneRelation]
  10.  * -- menuefooter [manyToOneRelation]
  11.  * -- startseite [manyToOneRelation]
  12.  * -- showlanguage [checkbox]
  13.  * - domainroot [manyToOneRelation]
  14.  * - gruntcache [checkbox]
  15.  * - cacheparam [checkbox]
  16.  * - imageoptim [checkbox]
  17.  * - getfile [select]
  18.  */
  19. namespace Pimcore\Model\DataObject;
  20. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  21. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  22. /**
  23. * @method static \Pimcore\Model\DataObject\Configset\Listing getList(array $config = [])
  24. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByLanguagefolder($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByNavstartnodeid($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByMenuefooter($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByStartseite($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByShowlanguage($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByDomainroot($value, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByGruntcache($value, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByCacheparam($value, $limit = 0, $offset = 0, $objectTypes = null)
  33. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByImageoptim($value, $limit = 0, $offset = 0, $objectTypes = null)
  34. * @method static \Pimcore\Model\DataObject\Configset\Listing|\Pimcore\Model\DataObject\Configset|null getByGetfile($value, $limit = 0, $offset = 0, $objectTypes = null)
  35. */
  36. class Configset extends Concrete
  37. {
  38. protected $o_classId "3";
  39. protected $o_className "configset";
  40. protected $localizedfields;
  41. protected $domainroot;
  42. protected $gruntcache;
  43. protected $cacheparam;
  44. protected $imageoptim;
  45. protected $getfile;
  46. /**
  47. * @param array $values
  48. * @return \Pimcore\Model\DataObject\Configset
  49. */
  50. public static function create($values = array()) {
  51.     $object = new static();
  52.     $object->setValues($values);
  53.     return $object;
  54. }
  55. /**
  56. * Get localizedfields - Navigation
  57. * @return \Pimcore\Model\DataObject\Localizedfield|null
  58. */
  59. public function getLocalizedfields()
  60. {
  61.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  62.         $preValue $this->preGetValue("localizedfields");
  63.         if ($preValue !== null) {
  64.             return $preValue;
  65.         }
  66.     }
  67.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  68.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  69.         return $data->getPlain();
  70.     }
  71.     return $data;
  72. }
  73. /**
  74. * Get languagefolder - Startelement Sprache
  75. * @return \Pimcore\Model\Document\Page|null
  76. */
  77. public function getLanguagefolder($language null)
  78. {
  79.     $data $this->getLocalizedfields()->getLocalizedValue("languagefolder"$language);
  80.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  81.         $preValue $this->preGetValue("languagefolder");
  82.         if ($preValue !== null) {
  83.             return $preValue;
  84.         }
  85.     }
  86.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  87.         return $data->getPlain();
  88.     }
  89.     return $data;
  90. }
  91. /**
  92. * Get navstartnodeid - NavStartNodeId
  93. * @return \Pimcore\Model\Document\Page|null
  94. */
  95. public function getNavstartnodeid($language null)
  96. {
  97.     $data $this->getLocalizedfields()->getLocalizedValue("navstartnodeid"$language);
  98.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  99.         $preValue $this->preGetValue("navstartnodeid");
  100.         if ($preValue !== null) {
  101.             return $preValue;
  102.         }
  103.     }
  104.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  105.         return $data->getPlain();
  106.     }
  107.     return $data;
  108. }
  109. /**
  110. * Get menuefooter - MenĂ¼-Footer Snippet
  111. * @return \Pimcore\Model\Document\Snippet|null
  112. */
  113. public function getMenuefooter($language null)
  114. {
  115.     $data $this->getLocalizedfields()->getLocalizedValue("menuefooter"$language);
  116.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  117.         $preValue $this->preGetValue("menuefooter");
  118.         if ($preValue !== null) {
  119.             return $preValue;
  120.         }
  121.     }
  122.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  123.         return $data->getPlain();
  124.     }
  125.     return $data;
  126. }
  127. /**
  128. * Get startseite - Startseite
  129. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document|null
  130. */
  131. public function getStartseite($language null)
  132. {
  133.     $data $this->getLocalizedfields()->getLocalizedValue("startseite"$language);
  134.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  135.         $preValue $this->preGetValue("startseite");
  136.         if ($preValue !== null) {
  137.             return $preValue;
  138.         }
  139.     }
  140.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  141.         return $data->getPlain();
  142.     }
  143.     return $data;
  144. }
  145. /**
  146. * Get showlanguage - Sprachauswahl zeigen
  147. * @return bool|null
  148. */
  149. public function getShowlanguage($language null)
  150. {
  151.     $data $this->getLocalizedfields()->getLocalizedValue("showlanguage"$language);
  152.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  153.         $preValue $this->preGetValue("showlanguage");
  154.         if ($preValue !== null) {
  155.             return $preValue;
  156.         }
  157.     }
  158.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  159.         return $data->getPlain();
  160.     }
  161.     return $data;
  162. }
  163. /**
  164. * Set localizedfields - Navigation
  165. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  166. * @return \Pimcore\Model\DataObject\Configset
  167. */
  168. public function setLocalizedfields($localizedfields)
  169. {
  170.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  171.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  172.     $currentData $this->getLocalizedfields();
  173.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  174.     $this->markFieldDirty("localizedfields"true);
  175.     $this->localizedfields $localizedfields;
  176.     return $this;
  177. }
  178. /**
  179. * Set languagefolder - Startelement Sprache
  180. * @param \Pimcore\Model\Document\Page|null $languagefolder
  181. * @return \Pimcore\Model\DataObject\Configset
  182. */
  183. public function setLanguagefolder ($languagefolder$language null)
  184. {
  185.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("languagefolder");
  186.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  187.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  188.     $currentData $this->getLanguagefolder($language);
  189.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  190.     $isEqual $fd->isEqual($currentData$languagefolder);
  191.     if (!$isEqual) {
  192.         $this->markFieldDirty("languagefolder"true);
  193.     }
  194.     $this->getLocalizedfields()->setLocalizedValue("languagefolder"$languagefolder$language, !$isEqual);
  195.     return $this;
  196. }
  197. /**
  198. * Set navstartnodeid - NavStartNodeId
  199. * @param \Pimcore\Model\Document\Page|null $navstartnodeid
  200. * @return \Pimcore\Model\DataObject\Configset
  201. */
  202. public function setNavstartnodeid ($navstartnodeid$language null)
  203. {
  204.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("navstartnodeid");
  205.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  206.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  207.     $currentData $this->getNavstartnodeid($language);
  208.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  209.     $isEqual $fd->isEqual($currentData$navstartnodeid);
  210.     if (!$isEqual) {
  211.         $this->markFieldDirty("navstartnodeid"true);
  212.     }
  213.     $this->getLocalizedfields()->setLocalizedValue("navstartnodeid"$navstartnodeid$language, !$isEqual);
  214.     return $this;
  215. }
  216. /**
  217. * Set menuefooter - MenĂ¼-Footer Snippet
  218. * @param \Pimcore\Model\Document\Snippet|null $menuefooter
  219. * @return \Pimcore\Model\DataObject\Configset
  220. */
  221. public function setMenuefooter ($menuefooter$language null)
  222. {
  223.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("menuefooter");
  224.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  225.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  226.     $currentData $this->getMenuefooter($language);
  227.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  228.     $isEqual $fd->isEqual($currentData$menuefooter);
  229.     if (!$isEqual) {
  230.         $this->markFieldDirty("menuefooter"true);
  231.     }
  232.     $this->getLocalizedfields()->setLocalizedValue("menuefooter"$menuefooter$language, !$isEqual);
  233.     return $this;
  234. }
  235. /**
  236. * Set startseite - Startseite
  237. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document|null $startseite
  238. * @return \Pimcore\Model\DataObject\Configset
  239. */
  240. public function setStartseite ($startseite$language null)
  241. {
  242.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("startseite");
  243.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  244.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  245.     $currentData $this->getStartseite($language);
  246.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  247.     $isEqual $fd->isEqual($currentData$startseite);
  248.     if (!$isEqual) {
  249.         $this->markFieldDirty("startseite"true);
  250.     }
  251.     $this->getLocalizedfields()->setLocalizedValue("startseite"$startseite$language, !$isEqual);
  252.     return $this;
  253. }
  254. /**
  255. * Set showlanguage - Sprachauswahl zeigen
  256. * @param bool|null $showlanguage
  257. * @return \Pimcore\Model\DataObject\Configset
  258. */
  259. public function setShowlanguage ($showlanguage$language null)
  260. {
  261.     $isEqual false;
  262.     $this->getLocalizedfields()->setLocalizedValue("showlanguage"$showlanguage$language, !$isEqual);
  263.     return $this;
  264. }
  265. /**
  266. * Get domainroot - Domain-Root
  267. * @return \Pimcore\Model\Document\Page|null
  268. */
  269. public function getDomainroot()
  270. {
  271.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  272.         $preValue $this->preGetValue("domainroot");
  273.         if ($preValue !== null) {
  274.             return $preValue;
  275.         }
  276.     }
  277.     $data $this->getClass()->getFieldDefinition("domainroot")->preGetData($this);
  278.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  279.         return $data->getPlain();
  280.     }
  281.     return $data;
  282. }
  283. /**
  284. * Set domainroot - Domain-Root
  285. * @param \Pimcore\Model\Document\Page|null $domainroot
  286. * @return \Pimcore\Model\DataObject\Configset
  287. */
  288. public function setDomainroot($domainroot)
  289. {
  290.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  291.     $fd $this->getClass()->getFieldDefinition("domainroot");
  292.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  293.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  294.     $currentData $this->getDomainroot();
  295.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  296.     $isEqual $fd->isEqual($currentData$domainroot);
  297.     if (!$isEqual) {
  298.         $this->markFieldDirty("domainroot"true);
  299.     }
  300.     $this->domainroot $fd->preSetData($this$domainroot);
  301.     return $this;
  302. }
  303. /**
  304. * Get gruntcache - Grunt Cache
  305. * @return bool|null
  306. */
  307. public function getGruntcache()
  308. {
  309.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  310.         $preValue $this->preGetValue("gruntcache");
  311.         if ($preValue !== null) {
  312.             return $preValue;
  313.         }
  314.     }
  315.     $data $this->gruntcache;
  316.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  317.         return $data->getPlain();
  318.     }
  319.     return $data;
  320. }
  321. /**
  322. * Set gruntcache - Grunt Cache
  323. * @param bool|null $gruntcache
  324. * @return \Pimcore\Model\DataObject\Configset
  325. */
  326. public function setGruntcache($gruntcache)
  327. {
  328.     $this->gruntcache $gruntcache;
  329.     return $this;
  330. }
  331. /**
  332. * Get cacheparam - Cache Parameter
  333. * @return bool|null
  334. */
  335. public function getCacheparam()
  336. {
  337.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  338.         $preValue $this->preGetValue("cacheparam");
  339.         if ($preValue !== null) {
  340.             return $preValue;
  341.         }
  342.     }
  343.     $data $this->cacheparam;
  344.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  345.         return $data->getPlain();
  346.     }
  347.     return $data;
  348. }
  349. /**
  350. * Set cacheparam - Cache Parameter
  351. * @param bool|null $cacheparam
  352. * @return \Pimcore\Model\DataObject\Configset
  353. */
  354. public function setCacheparam($cacheparam)
  355. {
  356.     $this->cacheparam $cacheparam;
  357.     return $this;
  358. }
  359. /**
  360. * Get imageoptim - ImageOptim nutzen
  361. * @return bool|null
  362. */
  363. public function getImageoptim()
  364. {
  365.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  366.         $preValue $this->preGetValue("imageoptim");
  367.         if ($preValue !== null) {
  368.             return $preValue;
  369.         }
  370.     }
  371.     $data $this->imageoptim;
  372.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  373.         return $data->getPlain();
  374.     }
  375.     return $data;
  376. }
  377. /**
  378. * Set imageoptim - ImageOptim nutzen
  379. * @param bool|null $imageoptim
  380. * @return \Pimcore\Model\DataObject\Configset
  381. */
  382. public function setImageoptim($imageoptim)
  383. {
  384.     $this->imageoptim $imageoptim;
  385.     return $this;
  386. }
  387. /**
  388. * Get getfile - get File per curl oder file_get_contents
  389. * @return string|null
  390. */
  391. public function getGetfile()
  392. {
  393.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  394.         $preValue $this->preGetValue("getfile");
  395.         if ($preValue !== null) {
  396.             return $preValue;
  397.         }
  398.     }
  399.     $data $this->getfile;
  400.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  401.         return $data->getPlain();
  402.     }
  403.     return $data;
  404. }
  405. /**
  406. * Set getfile - get File per curl oder file_get_contents
  407. * @param string|null $getfile
  408. * @return \Pimcore\Model\DataObject\Configset
  409. */
  410. public function setGetfile($getfile)
  411. {
  412.     $this->getfile $getfile;
  413.     return $this;
  414. }
  415. }