var/classes/DataObject/Event.php line 168

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