init
This commit is contained in:
230
src/Entity/Category.php
Normal file
230
src/Entity/Category.php
Normal file
@ -0,0 +1,230 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Category
|
||||
*
|
||||
* @ORM\Table(name="category")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\CategoryRepository")
|
||||
*/
|
||||
class Category
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="roworder", type="integer", nullable=true)
|
||||
*/
|
||||
private $order;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
*/
|
||||
private $usecategoryconfig;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $appthumbwidth;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $appthumbheight;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
*/
|
||||
private $appthumbfilter;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $appthumbfiltergrayscale;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $appthumbfilteropacity;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $appthumbfiltersepia;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Illustration", mappedBy="category", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
* @ORM\OrderBy({"id" = "DESC"})
|
||||
*/
|
||||
private $illustrations;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->illustrations = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(string $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrder(): ?int
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function setOrder(?int $order): self
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUsecategoryconfig(): ?bool
|
||||
{
|
||||
return $this->usecategoryconfig;
|
||||
}
|
||||
|
||||
public function setUsecategoryconfig(?bool $usecategoryconfig): self
|
||||
{
|
||||
$this->usecategoryconfig = $usecategoryconfig;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAppthumbwidth(): ?int
|
||||
{
|
||||
return $this->appthumbwidth;
|
||||
}
|
||||
|
||||
public function setAppthumbwidth(?int $appthumbwidth): self
|
||||
{
|
||||
$this->appthumbwidth = $appthumbwidth;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAppthumbheight(): ?int
|
||||
{
|
||||
return $this->appthumbheight;
|
||||
}
|
||||
|
||||
public function setAppthumbheight(?int $appthumbheight): self
|
||||
{
|
||||
$this->appthumbheight = $appthumbheight;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAppthumbfilter(): ?bool
|
||||
{
|
||||
return $this->appthumbfilter;
|
||||
}
|
||||
|
||||
public function setAppthumbfilter(?bool $appthumbfilter): self
|
||||
{
|
||||
$this->appthumbfilter = $appthumbfilter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAppthumbfiltergrayscale(): ?int
|
||||
{
|
||||
return $this->appthumbfiltergrayscale;
|
||||
}
|
||||
|
||||
public function setAppthumbfiltergrayscale(?int $appthumbfiltergrayscale): self
|
||||
{
|
||||
$this->appthumbfiltergrayscale = $appthumbfiltergrayscale;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAppthumbfilteropacity(): ?int
|
||||
{
|
||||
return $this->appthumbfilteropacity;
|
||||
}
|
||||
|
||||
public function setAppthumbfilteropacity(?int $appthumbfilteropacity): self
|
||||
{
|
||||
$this->appthumbfilteropacity = $appthumbfilteropacity;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAppthumbfiltersepia(): ?int
|
||||
{
|
||||
return $this->appthumbfiltersepia;
|
||||
}
|
||||
|
||||
public function setAppthumbfiltersepia(?int $appthumbfiltersepia): self
|
||||
{
|
||||
$this->appthumbfiltersepia = $appthumbfiltersepia;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Illustration[]
|
||||
*/
|
||||
public function getIllustrations(): Collection
|
||||
{
|
||||
return $this->illustrations;
|
||||
}
|
||||
|
||||
public function addIllustration(Illustration $illustration): self
|
||||
{
|
||||
if (!$this->illustrations->contains($illustration)) {
|
||||
$this->illustrations[] = $illustration;
|
||||
$illustration->setCategory($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeIllustration(Illustration $illustration): self
|
||||
{
|
||||
if ($this->illustrations->removeElement($illustration)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($illustration->getCategory() === $this) {
|
||||
$illustration->setCategory(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
202
src/Entity/Config.php
Normal file
202
src/Entity/Config.php
Normal file
@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Cron
|
||||
*
|
||||
* @ORM\Table(name="config")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ConfigRepository")
|
||||
*/
|
||||
class Config
|
||||
{ /**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250)
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="roworder", type="string")
|
||||
*/
|
||||
protected $order;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $visible;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $changeable;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $required;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $grouped;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $category;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
protected $help;
|
||||
|
||||
public function getId(): ?string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(string $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getValue(): ?string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function setValue(string $value): self
|
||||
{
|
||||
$this->value = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrder(): ?string
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function setOrder(string $order): self
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVisible(): ?bool
|
||||
{
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
public function setVisible(bool $visible): self
|
||||
{
|
||||
$this->visible = $visible;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getChangeable(): ?bool
|
||||
{
|
||||
return $this->changeable;
|
||||
}
|
||||
|
||||
public function setChangeable(bool $changeable): self
|
||||
{
|
||||
$this->changeable = $changeable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRequired(): ?bool
|
||||
{
|
||||
return $this->required;
|
||||
}
|
||||
|
||||
public function setRequired(bool $required): self
|
||||
{
|
||||
$this->required = $required;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setType(string $type): self
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGrouped(): ?string
|
||||
{
|
||||
return $this->grouped;
|
||||
}
|
||||
|
||||
public function setGrouped(string $grouped): self
|
||||
{
|
||||
$this->grouped = $grouped;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCategory(): ?string
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
public function setCategory(string $category): self
|
||||
{
|
||||
$this->category = $category;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHelp(): ?string
|
||||
{
|
||||
return $this->help;
|
||||
}
|
||||
|
||||
public function setHelp(string $help): self
|
||||
{
|
||||
$this->help = $help;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle(string $title): self
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
384
src/Entity/Cron.php
Normal file
384
src/Entity/Cron.php
Normal file
@ -0,0 +1,384 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Cron
|
||||
*
|
||||
* @ORM\Table(name="cron")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\CronRepository")
|
||||
*/
|
||||
class Cron
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="command", type="string", nullable=false)
|
||||
* @Assert\NotBlank()
|
||||
*
|
||||
*/
|
||||
private $command;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $statut;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=false)
|
||||
*/
|
||||
private $submitdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $startexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $endexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $nextexecdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $repeatcall;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $repeatexec;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $repeatinterval;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $jsonargument;
|
||||
|
||||
private $statutlabel;
|
||||
|
||||
// A garder pour forcer l'id en init
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
// A garder pour récupérer le label du statut
|
||||
public function getStatutlabel()
|
||||
{
|
||||
switch($this->statut) {
|
||||
case 0: $this->statutlabel="A éxécuter"; break;
|
||||
case 1: $this->statutlabel="Exécution en cours"; break;
|
||||
case 2: $this->statutlabel="OK"; break;
|
||||
case 3: $this->statutlabel="KO"; break;
|
||||
}
|
||||
return $this->statutlabel;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->submitdate = new \DateTime();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set command
|
||||
*
|
||||
* @param string $command
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setCommand($command)
|
||||
{
|
||||
$this->command = $command;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get command
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCommand()
|
||||
{
|
||||
return $this->command;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set description
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set statut
|
||||
*
|
||||
* @param integer $statut
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setStatut($statut)
|
||||
{
|
||||
$this->statut = $statut;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get statut
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getStatut()
|
||||
{
|
||||
return $this->statut;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set submitdate
|
||||
*
|
||||
* @param \DateTime $submitdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setSubmitdate($submitdate)
|
||||
{
|
||||
$this->submitdate = $submitdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get submitdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getSubmitdate()
|
||||
{
|
||||
return $this->submitdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set startexecdate
|
||||
*
|
||||
* @param \DateTime $startexecdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setStartexecdate($startexecdate)
|
||||
{
|
||||
$this->startexecdate = $startexecdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get startexecdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getStartexecdate()
|
||||
{
|
||||
return $this->startexecdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set endexecdate
|
||||
*
|
||||
* @param \DateTime $endexecdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setEndexecdate($endexecdate)
|
||||
{
|
||||
$this->endexecdate = $endexecdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get endexecdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getEndexecdate()
|
||||
{
|
||||
return $this->endexecdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set nextexecdate
|
||||
*
|
||||
* @param \DateTime $nextexecdate
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setNextexecdate($nextexecdate)
|
||||
{
|
||||
$this->nextexecdate = $nextexecdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get nextexecdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getNextexecdate()
|
||||
{
|
||||
return $this->nextexecdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repeatcall
|
||||
*
|
||||
* @param integer $repeatcall
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setRepeatcall($repeatcall)
|
||||
{
|
||||
$this->repeatcall = $repeatcall;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repeatcall
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRepeatcall()
|
||||
{
|
||||
return $this->repeatcall;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repeatexec
|
||||
*
|
||||
* @param integer $repeatexec
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setRepeatexec($repeatexec)
|
||||
{
|
||||
$this->repeatexec = $repeatexec;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repeatexec
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRepeatexec()
|
||||
{
|
||||
return $this->repeatexec;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set repeatinterval
|
||||
*
|
||||
* @param integer $repeatinterval
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setRepeatinterval($repeatinterval)
|
||||
{
|
||||
$this->repeatinterval = $repeatinterval;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repeatinterval
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRepeatinterval()
|
||||
{
|
||||
return $this->repeatinterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set jsonargument
|
||||
*
|
||||
* @param string $jsonargument
|
||||
*
|
||||
* @return Cron
|
||||
*/
|
||||
public function setJsonargument($jsonargument)
|
||||
{
|
||||
$this->jsonargument = $jsonargument;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get jsonargument
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getJsonargument()
|
||||
{
|
||||
return $this->jsonargument;
|
||||
}
|
||||
}
|
87
src/Entity/Group.php
Normal file
87
src/Entity/Group.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
* Group
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\GroupRepository")
|
||||
* @ORM\Table(name="groupe", uniqueConstraints={@ORM\UniqueConstraint(name="name", columns={"name"})})} )
|
||||
* @UniqueEntity("name", message="Ce nom de groupe existe dèja")
|
||||
*/
|
||||
class Group
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="name", type="string")
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="User", mappedBy="groups")
|
||||
*/
|
||||
protected $users;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->users = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|User[]
|
||||
*/
|
||||
public function getUsers(): Collection
|
||||
{
|
||||
return $this->users;
|
||||
}
|
||||
|
||||
public function addUser(User $user): self
|
||||
{
|
||||
if (!$this->users->contains($user)) {
|
||||
$this->users[] = $user;
|
||||
$user->addGroup($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeUser(User $user): self
|
||||
{
|
||||
if ($this->users->contains($user)) {
|
||||
$this->users->removeElement($user);
|
||||
$user->removeGroup($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
146
src/Entity/Illustration.php
Normal file
146
src/Entity/Illustration.php
Normal file
@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Illustration
|
||||
*
|
||||
* @ORM\Table(name="illustration")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\IllustrationRepository")
|
||||
*/
|
||||
class Illustration
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private $submittime;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $width;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $height;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
private $illustration;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Category")
|
||||
*/
|
||||
private $category;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): self
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSubmittime(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->submittime;
|
||||
}
|
||||
|
||||
public function setSubmittime(\DateTimeInterface $submittime): self
|
||||
{
|
||||
$this->submittime = $submittime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWidth(): ?int
|
||||
{
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
public function setWidth(int $width): self
|
||||
{
|
||||
$this->width = $width;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHeight(): ?int
|
||||
{
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
public function setHeight(int $height): self
|
||||
{
|
||||
$this->height = $height;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIllustration(): ?string
|
||||
{
|
||||
return $this->illustration;
|
||||
}
|
||||
|
||||
public function setIllustration(string $illustration): self
|
||||
{
|
||||
$this->illustration = $illustration;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCategory(): ?Category
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
public function setCategory(?Category $category): self
|
||||
{
|
||||
$this->category = $category;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
80
src/Entity/Link.php
Normal file
80
src/Entity/Link.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Link
|
||||
*
|
||||
* @ORM\Table(name="link")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\LinkRepository")
|
||||
*/
|
||||
class Link
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="roworder", type="integer", nullable=true)
|
||||
*/
|
||||
private $order;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
protected $url;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrder(): ?int
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function setOrder(?int $order): self
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUrl(): ?string
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
public function setUrl(string $url): self
|
||||
{
|
||||
$this->url = $url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
50
src/Entity/Script.php
Normal file
50
src/Entity/Script.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Script
|
||||
*
|
||||
* @ORM\Table(name="script")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ScriptRepository")
|
||||
*/
|
||||
class Script
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="name", type="string", nullable=false)
|
||||
* @Assert\NotBlank()
|
||||
*
|
||||
*/
|
||||
private $name;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
270
src/Entity/User.php
Normal file
270
src/Entity/User.php
Normal file
@ -0,0 +1,270 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
||||
* @ORM\Table(name="user",uniqueConstraints={@ORM\UniqueConstraint(name="username", columns={"username"})})
|
||||
* @UniqueEntity("username", message="Ce nom d'utilisateur existe dèja")
|
||||
*/
|
||||
|
||||
class User implements UserInterface, \Serializable
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="username", type="string", length=255)
|
||||
*/
|
||||
private $username;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="password", type="string", length=255)
|
||||
*/
|
||||
private $password;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(name="roles", type="array", length=255)
|
||||
*/
|
||||
private $roles = array();
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="salt", type="string", length=255)
|
||||
*/
|
||||
private $salt = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, nullable=true)
|
||||
*/
|
||||
private $firstname;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250)
|
||||
*/
|
||||
private $lastname;
|
||||
private $displayname;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=200, nullable=true, options={"default" : 0})
|
||||
*/
|
||||
private $avatar;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250)
|
||||
*/
|
||||
private $email;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Group", inversedBy="users", cascade={"persist"})
|
||||
* @ORM\JoinTable(name="usergroupe",
|
||||
* joinColumns={@ORM\JoinColumn(name="user", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="groupe", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
private $groups;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->groups = new ArrayCollection();
|
||||
$this->surveys = new ArrayCollection();
|
||||
$this->guests = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getUsername(): ?string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function getSalt(): ?string
|
||||
{
|
||||
return $this->salt;
|
||||
}
|
||||
|
||||
public function setPassword($password): self
|
||||
{
|
||||
if($password!=$this->password&&$password!=""&&!is_null($password)){
|
||||
$this->salt = uniqid(mt_rand(), true);
|
||||
$hash = "{SSHA}" . base64_encode(pack("H*", sha1($password . $this->salt)) . $this->salt);
|
||||
|
||||
$this->password = $hash;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function getRoles(): ?array
|
||||
{
|
||||
return $this->roles;
|
||||
}
|
||||
|
||||
public function hasRole(string $role): ?bool
|
||||
{
|
||||
return in_array($role,$this->roles);
|
||||
}
|
||||
|
||||
public function eraseCredentials()
|
||||
{
|
||||
}
|
||||
|
||||
public function serialize()
|
||||
{
|
||||
return serialize(array(
|
||||
$this->id,
|
||||
$this->username,
|
||||
$this->password,
|
||||
$this->salt,
|
||||
));
|
||||
}
|
||||
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
list (
|
||||
$this->id,
|
||||
$this->username,
|
||||
$this->password,
|
||||
$this->salt
|
||||
) = unserialize($serialized, array('allowed_classes' => false));
|
||||
}
|
||||
|
||||
public function getDisplayname()
|
||||
{
|
||||
return $this->firstname." ".$this->lastname;
|
||||
}
|
||||
|
||||
public function setId(int $id): self
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setUsername(string $username): self
|
||||
{
|
||||
$this->username = $username;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function setRoles(array $roles): self
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSalt(string $salt): self
|
||||
{
|
||||
$this->salt = $salt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstname(): ?string
|
||||
{
|
||||
return $this->firstname;
|
||||
}
|
||||
|
||||
public function setFirstname(?string $firstname): self
|
||||
{
|
||||
$this->firstname = $firstname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastname(): ?string
|
||||
{
|
||||
return $this->lastname;
|
||||
}
|
||||
|
||||
public function setLastname(?string $lastname): self
|
||||
{
|
||||
$this->lastname = $lastname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAvatar(): ?string
|
||||
{
|
||||
if($this->avatar)
|
||||
return $this->avatar;
|
||||
else
|
||||
return "noavatar.png";
|
||||
}
|
||||
|
||||
public function setAvatar(?string $avatar): self
|
||||
{
|
||||
$this->avatar = $avatar;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): self
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Group[]
|
||||
*/
|
||||
public function getGroups(): Collection
|
||||
{
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
public function addGroup(Group $group): self
|
||||
{
|
||||
if (!$this->groups->contains($group)) {
|
||||
$this->groups[] = $group;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeGroup(Group $group): self
|
||||
{
|
||||
if ($this->groups->contains($group)) {
|
||||
$this->groups->removeElement($group);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
172
src/Entity/Webzine.php
Normal file
172
src/Entity/Webzine.php
Normal file
@ -0,0 +1,172 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Webzine
|
||||
*
|
||||
* @ORM\Table(name="webzine")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\WebzineRepository")
|
||||
*/
|
||||
class Webzine
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private $submittime;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="setname", type="string", length=100, nullable=true)
|
||||
*/
|
||||
private $set;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="roworder", type="integer", nullable=true)
|
||||
*/
|
||||
private $order;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $mode;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Webzinepage", mappedBy="webzine", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
* @ORM\OrderBy({"order" = "ASC"})
|
||||
*/
|
||||
private $webzinepages;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->webzinepages = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): self
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSubmittime(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->submittime;
|
||||
}
|
||||
|
||||
public function setSubmittime(\DateTimeInterface $submittime): self
|
||||
{
|
||||
$this->submittime = $submittime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSet(): ?string
|
||||
{
|
||||
return $this->set;
|
||||
}
|
||||
|
||||
public function setSet(?string $set): self
|
||||
{
|
||||
$this->set = $set;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrder(): ?int
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function setOrder(?int $order): self
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMode(): ?int
|
||||
{
|
||||
return $this->mode;
|
||||
}
|
||||
|
||||
public function setMode(int $mode): self
|
||||
{
|
||||
$this->mode = $mode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Webzinepage[]
|
||||
*/
|
||||
public function getWebzinepages(): Collection
|
||||
{
|
||||
return $this->webzinepages;
|
||||
}
|
||||
|
||||
public function addWebzinepage(Webzinepage $webzinepage): self
|
||||
{
|
||||
if (!$this->webzinepages->contains($webzinepage)) {
|
||||
$this->webzinepages[] = $webzinepage;
|
||||
$webzinepage->setWebzine($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeWebzinepage(Webzinepage $webzinepage): self
|
||||
{
|
||||
if ($this->webzinepages->removeElement($webzinepage)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($webzinepage->getWebzine() === $this) {
|
||||
$webzinepage->setWebzine(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
111
src/Entity/Webzinepage.php
Normal file
111
src/Entity/Webzinepage.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Illustration
|
||||
*
|
||||
* @ORM\Table(name="webzinepage")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\WebzinepageRepository")
|
||||
*/
|
||||
class Webzinepage
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="roworder", type="integer", nullable=true)
|
||||
*/
|
||||
private $order;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $width;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $height;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
private $illustration;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Webzine")
|
||||
*/
|
||||
private $webzine;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getOrder(): ?int
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function setOrder(?int $order): self
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWidth(): ?int
|
||||
{
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
public function setWidth(int $width): self
|
||||
{
|
||||
$this->width = $width;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHeight(): ?int
|
||||
{
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
public function setHeight(int $height): self
|
||||
{
|
||||
$this->height = $height;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIllustration(): ?string
|
||||
{
|
||||
return $this->illustration;
|
||||
}
|
||||
|
||||
public function setIllustration(string $illustration): self
|
||||
{
|
||||
$this->illustration = $illustration;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWebzine(): ?Webzine
|
||||
{
|
||||
return $this->webzine;
|
||||
}
|
||||
|
||||
public function setWebzine(?Webzine $webzine): self
|
||||
{
|
||||
$this->webzine = $webzine;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user