var/classes/DataObject/CustomerSegment.php line 39

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - name [input]
  8.  * - interesseNumbirdsCode [input]
  9.  * - localizedfields [localizedfields]
  10.  * -- nameLocalized [input]
  11.  * - group [manyToOneRelation]
  12.  * - reference [input]
  13.  * - calculated [checkbox]
  14.  * - useAsTargetGroup [checkbox]
  15.  * - targetGroup [targetGroup]
  16.  * - targetgroupSegment [manyToOneRelation]
  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\CustomerSegment\Listing getList(array $config = [])
  23. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByInteresseNumbirdsCode($value, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByNameLocalized($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByGroup($value, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByReference($value, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByCalculated($value, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByUseAsTargetGroup($value, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByTargetGroup($value, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByTargetgroupSegment($value, $limit = 0, $offset = 0, $objectTypes = null)
  33. */
  34. class CustomerSegment extends \CustomerManagementFrameworkBundle\Model\AbstractCustomerSegment
  35. {
  36. protected $o_classId "2";
  37. protected $o_className "CustomerSegment";
  38. protected $name;
  39. protected $interesseNumbirdsCode;
  40. protected $localizedfields;
  41. protected $group;
  42. protected $reference;
  43. protected $calculated;
  44. protected $useAsTargetGroup;
  45. protected $targetGroup;
  46. protected $targetgroupSegment;
  47. /**
  48. * @param array $values
  49. * @return \Pimcore\Model\DataObject\CustomerSegment
  50. */
  51. public static function create($values = array()) {
  52.     $object = new static();
  53.     $object->setValues($values);
  54.     return $object;
  55. }
  56. /**
  57. * Get name - Segment name
  58. * @return string|null
  59. */
  60. public function getName(): ?string
  61. {
  62.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  63.         $preValue $this->preGetValue("name");
  64.         if ($preValue !== null) {
  65.             return $preValue;
  66.         }
  67.     }
  68.     $data $this->name;
  69.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  70.         return $data->getPlain();
  71.     }
  72.     return $data;
  73. }
  74. /**
  75. * Set name - Segment name
  76. * @param string|null $name
  77. * @return \Pimcore\Model\DataObject\CustomerSegment
  78. */
  79. public function setName(?string $name)
  80. {
  81.     $this->name $name;
  82.     return $this;
  83. }
  84. /**
  85. * Get interesseNumbirdsCode - Interesse Numbirds Code
  86. * @return string|null
  87. */
  88. public function getInteresseNumbirdsCode(): ?string
  89. {
  90.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  91.         $preValue $this->preGetValue("interesseNumbirdsCode");
  92.         if ($preValue !== null) {
  93.             return $preValue;
  94.         }
  95.     }
  96.     $data $this->interesseNumbirdsCode;
  97.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  98.         return $data->getPlain();
  99.     }
  100.     return $data;
  101. }
  102. /**
  103. * Set interesseNumbirdsCode - Interesse Numbirds Code
  104. * @param string|null $interesseNumbirdsCode
  105. * @return \Pimcore\Model\DataObject\CustomerSegment
  106. */
  107. public function setInteresseNumbirdsCode(?string $interesseNumbirdsCode)
  108. {
  109.     $this->interesseNumbirdsCode $interesseNumbirdsCode;
  110.     return $this;
  111. }
  112. /**
  113. * Get localizedfields - 
  114. * @return \Pimcore\Model\DataObject\Localizedfield|null
  115. */
  116. public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
  117. {
  118.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  119.         $preValue $this->preGetValue("localizedfields");
  120.         if ($preValue !== null) {
  121.             return $preValue;
  122.         }
  123.     }
  124.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  125.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  126.         return $data->getPlain();
  127.     }
  128.     return $data;
  129. }
  130. /**
  131. * Get nameLocalized - nameLocalized
  132. * @return string|null
  133. */
  134. public function getNameLocalized($language null): ?string
  135. {
  136.     $data $this->getLocalizedfields()->getLocalizedValue("nameLocalized"$language);
  137.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  138.         $preValue $this->preGetValue("nameLocalized");
  139.         if ($preValue !== null) {
  140.             return $preValue;
  141.         }
  142.     }
  143.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  144.         return $data->getPlain();
  145.     }
  146.     return $data;
  147. }
  148. /**
  149. * Set localizedfields - 
  150. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  151. * @return \Pimcore\Model\DataObject\CustomerSegment
  152. */
  153. public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
  154. {
  155.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  156.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  157.     $currentData $this->getLocalizedfields();
  158.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  159.     $this->markFieldDirty("localizedfields"true);
  160.     $this->localizedfields $localizedfields;
  161.     return $this;
  162. }
  163. /**
  164. * Set nameLocalized - nameLocalized
  165. * @param string|null $nameLocalized
  166. * @return \Pimcore\Model\DataObject\CustomerSegment
  167. */
  168. public function setNameLocalized (?string $nameLocalized$language null)
  169. {
  170.     $isEqual false;
  171.     $this->getLocalizedfields()->setLocalizedValue("nameLocalized"$nameLocalized$language, !$isEqual);
  172.     return $this;
  173. }
  174. /**
  175. * Get group - Group
  176. * @return \Pimcore\Model\DataObject\AbstractObject|null
  177. */
  178. public function getGroup(): ?\Pimcore\Model\Element\AbstractElement
  179. {
  180.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  181.         $preValue $this->preGetValue("group");
  182.         if ($preValue !== null) {
  183.             return $preValue;
  184.         }
  185.     }
  186.     $data $this->getClass()->getFieldDefinition("group")->preGetData($this);
  187.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  188.         return $data->getPlain();
  189.     }
  190.     return $data;
  191. }
  192. /**
  193. * Set group - Group
  194. * @param \Pimcore\Model\DataObject\AbstractObject|null $group
  195. * @return \Pimcore\Model\DataObject\CustomerSegment
  196. */
  197. public function setGroup(?\Pimcore\Model\Element\AbstractElement $group)
  198. {
  199.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  200.     $fd $this->getClass()->getFieldDefinition("group");
  201.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  202.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  203.     $currentData $this->getGroup();
  204.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  205.     $isEqual $fd->isEqual($currentData$group);
  206.     if (!$isEqual) {
  207.         $this->markFieldDirty("group"true);
  208.     }
  209.     $this->group $fd->preSetData($this$group);
  210.     return $this;
  211. }
  212. /**
  213. * Get reference - Reference
  214. * @return string|null
  215. */
  216. public function getReference(): ?string
  217. {
  218.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  219.         $preValue $this->preGetValue("reference");
  220.         if ($preValue !== null) {
  221.             return $preValue;
  222.         }
  223.     }
  224.     $data $this->reference;
  225.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  226.         return $data->getPlain();
  227.     }
  228.     return $data;
  229. }
  230. /**
  231. * Set reference - Reference
  232. * @param string|null $reference
  233. * @return \Pimcore\Model\DataObject\CustomerSegment
  234. */
  235. public function setReference(?string $reference)
  236. {
  237.     $this->reference $reference;
  238.     return $this;
  239. }
  240. /**
  241. * Get calculated - calculated
  242. * @return bool|null
  243. */
  244. public function getCalculated(): ?bool
  245. {
  246.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  247.         $preValue $this->preGetValue("calculated");
  248.         if ($preValue !== null) {
  249.             return $preValue;
  250.         }
  251.     }
  252.     $data $this->calculated;
  253.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  254.         return $data->getPlain();
  255.     }
  256.     return $data;
  257. }
  258. /**
  259. * Set calculated - calculated
  260. * @param bool|null $calculated
  261. * @return \Pimcore\Model\DataObject\CustomerSegment
  262. */
  263. public function setCalculated(?bool $calculated)
  264. {
  265.     $this->calculated $calculated;
  266.     return $this;
  267. }
  268. /**
  269. * Get useAsTargetGroup - Use As Target Group
  270. * @return bool|null
  271. */
  272. public function getUseAsTargetGroup(): ?bool
  273. {
  274.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  275.         $preValue $this->preGetValue("useAsTargetGroup");
  276.         if ($preValue !== null) {
  277.             return $preValue;
  278.         }
  279.     }
  280.     $data $this->useAsTargetGroup;
  281.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  282.         return $data->getPlain();
  283.     }
  284.     return $data;
  285. }
  286. /**
  287. * Set useAsTargetGroup - Use As Target Group
  288. * @param bool|null $useAsTargetGroup
  289. * @return \Pimcore\Model\DataObject\CustomerSegment
  290. */
  291. public function setUseAsTargetGroup(?bool $useAsTargetGroup)
  292. {
  293.     $this->useAsTargetGroup $useAsTargetGroup;
  294.     return $this;
  295. }
  296. /**
  297. * Get targetGroup - Linked TargetGroup
  298. * @return string|null
  299. */
  300. public function getTargetGroup(): ?string
  301. {
  302.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  303.         $preValue $this->preGetValue("targetGroup");
  304.         if ($preValue !== null) {
  305.             return $preValue;
  306.         }
  307.     }
  308.     $data $this->targetGroup;
  309.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  310.         return $data->getPlain();
  311.     }
  312.     return $data;
  313. }
  314. /**
  315. * Set targetGroup - Linked TargetGroup
  316. * @param string|null $targetGroup
  317. * @return \Pimcore\Model\DataObject\CustomerSegment
  318. */
  319. public function setTargetGroup(?string $targetGroup)
  320. {
  321.     $this->targetGroup $targetGroup;
  322.     return $this;
  323. }
  324. /**
  325. * Get targetgroupSegment - targetgroupSegment
  326. * @return \Pimcore\Model\DataObject\CustomerSegment|null
  327. */
  328. public function getTargetgroupSegment(): ?\Pimcore\Model\Element\AbstractElement
  329. {
  330.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  331.         $preValue $this->preGetValue("targetgroupSegment");
  332.         if ($preValue !== null) {
  333.             return $preValue;
  334.         }
  335.     }
  336.     $data $this->getClass()->getFieldDefinition("targetgroupSegment")->preGetData($this);
  337.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  338.         return $data->getPlain();
  339.     }
  340.     return $data;
  341. }
  342. /**
  343. * Set targetgroupSegment - targetgroupSegment
  344. * @param \Pimcore\Model\DataObject\CustomerSegment|null $targetgroupSegment
  345. * @return \Pimcore\Model\DataObject\CustomerSegment
  346. */
  347. public function setTargetgroupSegment(?\Pimcore\Model\Element\AbstractElement $targetgroupSegment)
  348. {
  349.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  350.     $fd $this->getClass()->getFieldDefinition("targetgroupSegment");
  351.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  352.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  353.     $currentData $this->getTargetgroupSegment();
  354.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  355.     $isEqual $fd->isEqual($currentData$targetgroupSegment);
  356.     if (!$isEqual) {
  357.         $this->markFieldDirty("targetgroupSegment"true);
  358.     }
  359.     $this->targetgroupSegment $fd->preSetData($this$targetgroupSegment);
  360.     return $this;
  361. }
  362. }