var/classes/DataObject/CustomerSegment.php line 100

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - name [input]
  8.  * - group [manyToOneRelation]
  9.  * - reference [input]
  10.  * - calculated [checkbox]
  11.  * - useAsTargetGroup [checkbox]
  12.  * - targetGroup [targetGroup]
  13.  */
  14. namespace Pimcore\Model\DataObject;
  15. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  16. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  17. /**
  18. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing getList(array $config = [])
  19. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByGroup($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByReference($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByCalculated($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByUseAsTargetGroup($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\CustomerSegment\Listing|\Pimcore\Model\DataObject\CustomerSegment|null getByTargetGroup($value, $limit = 0, $offset = 0, $objectTypes = null)
  25. */
  26. class CustomerSegment extends \CustomerManagementFrameworkBundle\Model\AbstractCustomerSegment
  27. {
  28. protected $o_classId "2";
  29. protected $o_className "CustomerSegment";
  30. protected $name;
  31. protected $group;
  32. protected $reference;
  33. protected $calculated;
  34. protected $useAsTargetGroup;
  35. protected $targetGroup;
  36. /**
  37. * @param array $values
  38. * @return \Pimcore\Model\DataObject\CustomerSegment
  39. */
  40. public static function create($values = array()) {
  41.     $object = new static();
  42.     $object->setValues($values);
  43.     return $object;
  44. }
  45. /**
  46. * Get name - Segment name
  47. * @return string|null
  48. */
  49. public function getName(): ?string
  50. {
  51.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  52.         $preValue $this->preGetValue("name");
  53.         if ($preValue !== null) {
  54.             return $preValue;
  55.         }
  56.     }
  57.     $data $this->name;
  58.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  59.         return $data->getPlain();
  60.     }
  61.     return $data;
  62. }
  63. /**
  64. * Set name - Segment name
  65. * @param string|null $name
  66. * @return \Pimcore\Model\DataObject\CustomerSegment
  67. */
  68. public function setName(?string $name)
  69. {
  70.     $this->name $name;
  71.     return $this;
  72. }
  73. /**
  74. * Get group - Group
  75. * @return \Pimcore\Model\DataObject\AbstractObject|null
  76. */
  77. public function getGroup(): ?\Pimcore\Model\Element\AbstractElement
  78. {
  79.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  80.         $preValue $this->preGetValue("group");
  81.         if ($preValue !== null) {
  82.             return $preValue;
  83.         }
  84.     }
  85.     $data $this->getClass()->getFieldDefinition("group")->preGetData($this);
  86.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  87.         return $data->getPlain();
  88.     }
  89.     return $data;
  90. }
  91. /**
  92. * Set group - Group
  93. * @param \Pimcore\Model\DataObject\AbstractObject|null $group
  94. * @return \Pimcore\Model\DataObject\CustomerSegment
  95. */
  96. public function setGroup(?\Pimcore\Model\Element\AbstractElement $group)
  97. {
  98.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  99.     $fd $this->getClass()->getFieldDefinition("group");
  100.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  101.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  102.     $currentData $this->getGroup();
  103.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  104.     $isEqual $fd->isEqual($currentData$group);
  105.     if (!$isEqual) {
  106.         $this->markFieldDirty("group"true);
  107.     }
  108.     $this->group $fd->preSetData($this$group);
  109.     return $this;
  110. }
  111. /**
  112. * Get reference - Reference
  113. * @return string|null
  114. */
  115. public function getReference(): ?string
  116. {
  117.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  118.         $preValue $this->preGetValue("reference");
  119.         if ($preValue !== null) {
  120.             return $preValue;
  121.         }
  122.     }
  123.     $data $this->reference;
  124.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  125.         return $data->getPlain();
  126.     }
  127.     return $data;
  128. }
  129. /**
  130. * Set reference - Reference
  131. * @param string|null $reference
  132. * @return \Pimcore\Model\DataObject\CustomerSegment
  133. */
  134. public function setReference(?string $reference)
  135. {
  136.     $this->reference $reference;
  137.     return $this;
  138. }
  139. /**
  140. * Get calculated - calculated
  141. * @return bool|null
  142. */
  143. public function getCalculated(): ?bool
  144. {
  145.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  146.         $preValue $this->preGetValue("calculated");
  147.         if ($preValue !== null) {
  148.             return $preValue;
  149.         }
  150.     }
  151.     $data $this->calculated;
  152.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  153.         return $data->getPlain();
  154.     }
  155.     return $data;
  156. }
  157. /**
  158. * Set calculated - calculated
  159. * @param bool|null $calculated
  160. * @return \Pimcore\Model\DataObject\CustomerSegment
  161. */
  162. public function setCalculated(?bool $calculated)
  163. {
  164.     $this->calculated $calculated;
  165.     return $this;
  166. }
  167. /**
  168. * Get useAsTargetGroup - Use As Target Group
  169. * @return bool|null
  170. */
  171. public function getUseAsTargetGroup(): ?bool
  172. {
  173.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  174.         $preValue $this->preGetValue("useAsTargetGroup");
  175.         if ($preValue !== null) {
  176.             return $preValue;
  177.         }
  178.     }
  179.     $data $this->useAsTargetGroup;
  180.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  181.         return $data->getPlain();
  182.     }
  183.     return $data;
  184. }
  185. /**
  186. * Set useAsTargetGroup - Use As Target Group
  187. * @param bool|null $useAsTargetGroup
  188. * @return \Pimcore\Model\DataObject\CustomerSegment
  189. */
  190. public function setUseAsTargetGroup(?bool $useAsTargetGroup)
  191. {
  192.     $this->useAsTargetGroup $useAsTargetGroup;
  193.     return $this;
  194. }
  195. /**
  196. * Get targetGroup - Linked TargetGroup
  197. * @return string|null
  198. */
  199. public function getTargetGroup(): ?string
  200. {
  201.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  202.         $preValue $this->preGetValue("targetGroup");
  203.         if ($preValue !== null) {
  204.             return $preValue;
  205.         }
  206.     }
  207.     $data $this->targetGroup;
  208.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  209.         return $data->getPlain();
  210.     }
  211.     return $data;
  212. }
  213. /**
  214. * Set targetGroup - Linked TargetGroup
  215. * @param string|null $targetGroup
  216. * @return \Pimcore\Model\DataObject\CustomerSegment
  217. */
  218. public function setTargetGroup(?string $targetGroup)
  219. {
  220.     $this->targetGroup $targetGroup;
  221.     return $this;
  222. }
  223. }