1 <?php
declare(strict_types
=1);
4 * this file is part of the rapsys packbundle package.
6 * (c) raphaël gertz <symfony@rapsys.eu>
8 * for the full copyright and license information, please view the license
9 * file that was distributed with this source code.
12 namespace Rapsys\AirBundle\Entity
;
14 use Doctrine\ORM\Event\PreUpdateEventArgs
;
33 protected $description;
98 public function __construct() {
100 $this->description
= null;
105 $this->contact
= null;
106 $this->donate
= null;
108 $this->profile
= null;
109 $this->created
= new \
DateTime('now');
110 $this->updated
= new \
DateTime('now');
111 $this->location
= null;
119 public function getId(): int {
126 * @param string $locale
130 public function setLocale(string $locale): Snippet
{
131 $this->locale
= $locale;
141 public function getLocale(): string {
142 return $this->locale
;
148 * @param string $description
152 public function setDescription(?string $description): Snippet
{
153 $this->description
= $description;
163 public function getDescription(): ?string {
164 return $this->description
;
170 * @param string $class
174 public function setClass(?string $class): Snippet
{
175 $this->class = $class;
185 public function getClass(): ?string {
192 * @param string $short
196 public function setShort(?string $short): Snippet
{
197 $this->short
= $short;
207 public function getShort(): ?string {
218 public function setRate(?int $rate): Snippet
{
229 public function getRate(): ?int {
240 public function setHat(?bool $hat): Snippet
{
251 public function getHat(): ?bool {
257 * @param string $contact
261 public function setContact(?string $contact): Snippet
{
262 $this->contact
= $contact;
272 public function getContact(): ?string {
273 return $this->contact
;
279 * @param string $donate
283 public function setDonate(?string $donate): Snippet
{
284 $this->donate
= $donate;
294 public function getDonate(): ?string {
295 return $this->donate
;
301 * @param string $link
305 public function setLink(?string $link): Snippet
{
316 public function getLink(): ?string {
323 * @param string $profile
327 public function setProfile(?string $profile): Snippet
{
328 $this->profile
= $profile;
338 public function getProfile(): ?string {
339 return $this->profile
;
345 * @param \DateTime $created
349 public function setCreated(\DateTime
$created): Snippet
{
350 $this->created
= $created;
360 public function getCreated(): \DateTime
{
361 return $this->created
;
367 * @param \DateTime $updated
371 public function setUpdated(\DateTime
$updated): Snippet
{
372 $this->updated
= $updated;
382 public function getUpdated(): \DateTime
{
383 return $this->updated
;
389 * @param Location $location
393 public function setLocation(Location
$location) {
394 $this->location
= $location;
404 public function getLocation() {
405 return $this->location
;
415 public function setUser(User
$user) {
426 public function getUser() {
433 public function preUpdate(\Doctrine\ORM\Event\PreUpdateEventArgs
$eventArgs) {
434 //Check that we have an snippet instance
435 if (($snippet = $eventArgs->getEntity()) instanceof Snippet
) {
437 $snippet->setUpdated(new \
DateTime('now'));