var/classes/DataObject/Sponsor.php line 158

Open in your IDE?
  1. <?php
  2. /**
  3. * Inheritance: no
  4. * Variants: no
  5. *
  6. * Fields Summary:
  7. * - name [input]
  8. * - active [checkbox]
  9. * - location [input]
  10. * - description [wysiwyg]
  11. * - logo [image]
  12. * - homepage [link]
  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\Sponsor\Listing getList(array $config = [])
  19. * @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByActive($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. * @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByLocation($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByDescription($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\Sponsor\Listing|\Pimcore\Model\DataObject\Sponsor|null getByLogo($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. */
  25. class Sponsor extends Concrete
  26. {
  27. protected $o_classId = "Sponsor";
  28. protected $o_className = "Sponsor";
  29. protected $name;
  30. protected $active;
  31. protected $location;
  32. protected $description;
  33. protected $logo;
  34. protected $homepage;
  35. /**
  36. * @param array $values
  37. * @return \Pimcore\Model\DataObject\Sponsor
  38. */
  39. public static function create($values = array()) {
  40. $object = new static();
  41. $object->setValues($values);
  42. return $object;
  43. }
  44. /**
  45. * Get name - Name
  46. * @return string|null
  47. */
  48. public function getName(): ?string
  49. {
  50. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  51. $preValue = $this->preGetValue("name");
  52. if ($preValue !== null) {
  53. return $preValue;
  54. }
  55. }
  56. $data = $this->name;
  57. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  58. return $data->getPlain();
  59. }
  60. return $data;
  61. }
  62. /**
  63. * Set name - Name
  64. * @param string|null $name
  65. * @return \Pimcore\Model\DataObject\Sponsor
  66. */
  67. public function setName(?string $name)
  68. {
  69. $this->name = $name;
  70. return $this;
  71. }
  72. /**
  73. * Get active - Active
  74. * @return bool|null
  75. */
  76. public function getActive(): ?bool
  77. {
  78. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  79. $preValue = $this->preGetValue("active");
  80. if ($preValue !== null) {
  81. return $preValue;
  82. }
  83. }
  84. $data = $this->active;
  85. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  86. return $data->getPlain();
  87. }
  88. return $data;
  89. }
  90. /**
  91. * Set active - Active
  92. * @param bool|null $active
  93. * @return \Pimcore\Model\DataObject\Sponsor
  94. */
  95. public function setActive(?bool $active)
  96. {
  97. $this->active = $active;
  98. return $this;
  99. }
  100. /**
  101. * Get location - Location
  102. * @return string|null
  103. */
  104. public function getLocation(): ?string
  105. {
  106. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  107. $preValue = $this->preGetValue("location");
  108. if ($preValue !== null) {
  109. return $preValue;
  110. }
  111. }
  112. $data = $this->location;
  113. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  114. return $data->getPlain();
  115. }
  116. return $data;
  117. }
  118. /**
  119. * Set location - Location
  120. * @param string|null $location
  121. * @return \Pimcore\Model\DataObject\Sponsor
  122. */
  123. public function setLocation(?string $location)
  124. {
  125. $this->location = $location;
  126. return $this;
  127. }
  128. /**
  129. * Get description - Description
  130. * @return string|null
  131. */
  132. public function getDescription(): ?string
  133. {
  134. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  135. $preValue = $this->preGetValue("description");
  136. if ($preValue !== null) {
  137. return $preValue;
  138. }
  139. }
  140. $data = $this->getClass()->getFieldDefinition("description")->preGetData($this);
  141. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  142. return $data->getPlain();
  143. }
  144. return $data;
  145. }
  146. /**
  147. * Set description - Description
  148. * @param string|null $description
  149. * @return \Pimcore\Model\DataObject\Sponsor
  150. */
  151. public function setDescription(?string $description)
  152. {
  153. $this->description = $description;
  154. return $this;
  155. }
  156. /**
  157. * Get logo - Logo
  158. * @return \Pimcore\Model\Asset\Image|null
  159. */
  160. public function getLogo(): ?\Pimcore\Model\Asset\Image
  161. {
  162. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  163. $preValue = $this->preGetValue("logo");
  164. if ($preValue !== null) {
  165. return $preValue;
  166. }
  167. }
  168. $data = $this->logo;
  169. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  170. return $data->getPlain();
  171. }
  172. return $data;
  173. }
  174. /**
  175. * Set logo - Logo
  176. * @param \Pimcore\Model\Asset\Image|null $logo
  177. * @return \Pimcore\Model\DataObject\Sponsor
  178. */
  179. public function setLogo(?\Pimcore\Model\Asset\Image $logo)
  180. {
  181. $this->logo = $logo;
  182. return $this;
  183. }
  184. /**
  185. * Get homepage - Homepage
  186. * @return \Pimcore\Model\DataObject\Data\Link|null
  187. */
  188. public function getHomepage(): ?\Pimcore\Model\DataObject\Data\Link
  189. {
  190. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  191. $preValue = $this->preGetValue("homepage");
  192. if ($preValue !== null) {
  193. return $preValue;
  194. }
  195. }
  196. $data = $this->homepage;
  197. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  198. return $data->getPlain();
  199. }
  200. return $data;
  201. }
  202. /**
  203. * Set homepage - Homepage
  204. * @param \Pimcore\Model\DataObject\Data\Link|null $homepage
  205. * @return \Pimcore\Model\DataObject\Sponsor
  206. */
  207. public function setHomepage(?\Pimcore\Model\DataObject\Data\Link $homepage)
  208. {
  209. $this->homepage = $homepage;
  210. return $this;
  211. }
  212. }