<?php
namespace App\Entity;
use App\Repository\FormationRepository;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\JoinColumn;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=FormationRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class Formation
{
use DateTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotNull(message="Le champ titre doit ĂȘtre renseignĂ©")
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $content;
/**
* @ORM\Column(type="integer")
*/
private $notify=0;
/**
* @Assert\Url(
* relativeProtocol = true
* )
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $link;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $items;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $users;
/**
* @ORM\ManyToOne(targetEntity=User::class,inversedBy="formation")
* @ORM\JoinColumn(name="owner_id",referencedColumnName="id",onDelete="CASCADE",nullable=false)
*/
private $owner;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default":0})
*/
private $published = false;
/**
* @ORM\OneToMany(targetEntity="App\Entity\FormationRegistration", mappedBy="formation",cascade={"remove"} )
*
*/
private $registration;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getLink(): ?string
{
return $this->link;
}
public function setLink(string $link): self
{
$this->link = $link;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getItems(): ?string
{
return $this->items;
}
public function setItems(string $items): self
{
$this->items = $items;
return $this;
}
/**
* @return mixed
*/
public function getOwner()
{
return $this->owner;
}
/**
* @param mixed $owner
*/
public function setOwner($owner): void
{
$this->owner = $owner;
}
/**
* @return bool
*/
public function isPublished(): bool
{
return $this->published;
}
/**
* @param bool $published
*/
public function setPublished(bool $published): void
{
$this->published = $published;
}
/**
* @return mixed
*/
public function getUsers()
{
return $this->users;
}
/**
* @param mixed $users
*/
public function setUsers($users): void
{
$this->users = $users;
}
/**
* @return int
*/
public function getNotify(): bool
{
return $this->notify;
}
/**
* @param int $notify
*/
public function setNotify(int $notify): void
{
$this->notify = $notify;
}
}