var/classes/DataObject/TeamPosition.php line 27

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - legacyId [input]
  8.  * - localizedfields [localizedfields]
  9.  * -- name [input]
  10.  * -- sorting [numeric]
  11.  */
  12. namespace Pimcore\Model\DataObject;
  13. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  14. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  15. /**
  16. * @method static \Pimcore\Model\DataObject\TeamPosition\Listing getList(array $config = [])
  17. * @method static \Pimcore\Model\DataObject\TeamPosition\Listing|\Pimcore\Model\DataObject\TeamPosition|null getByLegacyId($value, $limit = 0, $offset = 0, $objectTypes = null)
  18. * @method static \Pimcore\Model\DataObject\TeamPosition\Listing|\Pimcore\Model\DataObject\TeamPosition|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  19. * @method static \Pimcore\Model\DataObject\TeamPosition\Listing|\Pimcore\Model\DataObject\TeamPosition|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\TeamPosition\Listing|\Pimcore\Model\DataObject\TeamPosition|null getBySorting($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  21. */
  22. class TeamPosition extends Concrete
  23. {
  24. protected $o_classId "TeamPosition";
  25. protected $o_className "TeamPosition";
  26. protected $legacyId;
  27. protected $localizedfields;
  28. /**
  29. * @param array $values
  30. * @return \Pimcore\Model\DataObject\TeamPosition
  31. */
  32. public static function create($values = array()) {
  33.     $object = new static();
  34.     $object->setValues($values);
  35.     return $object;
  36. }
  37. /**
  38. * Get legacyId - legacyId
  39. * @return string|null
  40. */
  41. public function getLegacyId()
  42. {
  43.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  44.         $preValue $this->preGetValue("legacyId");
  45.         if ($preValue !== null) {
  46.             return $preValue;
  47.         }
  48.     }
  49.     $data $this->legacyId;
  50.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  51.         return $data->getPlain();
  52.     }
  53.     return $data;
  54. }
  55. /**
  56. * Set legacyId - legacyId
  57. * @param string|null $legacyId
  58. * @return \Pimcore\Model\DataObject\TeamPosition
  59. */
  60. public function setLegacyId($legacyId)
  61. {
  62.     $this->legacyId $legacyId;
  63.     return $this;
  64. }
  65. /**
  66. * Get localizedfields - 
  67. * @return \Pimcore\Model\DataObject\Localizedfield|null
  68. */
  69. public function getLocalizedfields()
  70. {
  71.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  72.         $preValue $this->preGetValue("localizedfields");
  73.         if ($preValue !== null) {
  74.             return $preValue;
  75.         }
  76.     }
  77.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  78.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  79.         return $data->getPlain();
  80.     }
  81.     return $data;
  82. }
  83. /**
  84. * Get name - Name
  85. * @return string|null
  86. */
  87. public function getName($language null)
  88. {
  89.     $data $this->getLocalizedfields()->getLocalizedValue("name"$language);
  90.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  91.         $preValue $this->preGetValue("name");
  92.         if ($preValue !== null) {
  93.             return $preValue;
  94.         }
  95.     }
  96.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  97.         return $data->getPlain();
  98.     }
  99.     return $data;
  100. }
  101. /**
  102. * Get sorting - Sortierung / Priorität
  103. * @return float|null
  104. */
  105. public function getSorting($language null)
  106. {
  107.     $data $this->getLocalizedfields()->getLocalizedValue("sorting"$language);
  108.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  109.         $preValue $this->preGetValue("sorting");
  110.         if ($preValue !== null) {
  111.             return $preValue;
  112.         }
  113.     }
  114.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  115.         return $data->getPlain();
  116.     }
  117.     return $data;
  118. }
  119. /**
  120. * Set localizedfields - 
  121. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  122. * @return \Pimcore\Model\DataObject\TeamPosition
  123. */
  124. public function setLocalizedfields($localizedfields)
  125. {
  126.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  127.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  128.     $currentData $this->getLocalizedfields();
  129.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  130.     $this->markFieldDirty("localizedfields"true);
  131.     $this->localizedfields $localizedfields;
  132.     return $this;
  133. }
  134. /**
  135. * Set name - Name
  136. * @param string|null $name
  137. * @return \Pimcore\Model\DataObject\TeamPosition
  138. */
  139. public function setName ($name$language null)
  140. {
  141.     $isEqual false;
  142.     $this->getLocalizedfields()->setLocalizedValue("name"$name$language, !$isEqual);
  143.     return $this;
  144. }
  145. /**
  146. * Set sorting - Sortierung / Priorität
  147. * @param float|null $sorting
  148. * @return \Pimcore\Model\DataObject\TeamPosition
  149. */
  150. public function setSorting ($sorting$language null)
  151. {
  152.     $isEqual false;
  153.     $this->getLocalizedfields()->setLocalizedValue("sorting"$sorting$language, !$isEqual);
  154.     return $this;
  155. }
  156. }