@@ -1,27 +0,0 @@ | |||
<?php | |||
namespace Lc\SovBundle\Doctrine\Extension; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Gedmo\Mapping\Annotation as Gedmo; | |||
use Lc\SovBundle\Model\User\UserInterface; | |||
trait BlameableNullableTrait | |||
{ | |||
/** | |||
* @Gedmo\Blameable(on="create") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=true) | |||
*/ | |||
protected $createdBy; | |||
/** | |||
* @Gedmo\Blameable(on="update") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=true) | |||
*/ | |||
protected $updatedBy; | |||
} |
@@ -9,43 +9,43 @@ use Lc\SovBundle\Model\User\UserInterface; | |||
trait BlameableTrait | |||
{ | |||
/** | |||
* @Gedmo\Blameable(on="create") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $createdBy; | |||
/** | |||
* @Gedmo\Blameable(on="update") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $updatedBy; | |||
public function getCreatedBy(): ?UserInterface | |||
{ | |||
return $this->createdBy; | |||
} | |||
public function setCreatedBy(?UserInterface $createdBy): self | |||
{ | |||
$this->createdBy = $createdBy; | |||
return $this; | |||
} | |||
public function getUpdatedBy(): ?UserInterface | |||
{ | |||
return $this->updatedBy; | |||
} | |||
public function setUpdatedBy(?UserInterface $updatedBy): self | |||
{ | |||
$this->updatedBy = $updatedBy; | |||
return $this; | |||
} | |||
/** | |||
* @Gedmo\Blameable(on="create") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $createdBy; | |||
/** | |||
* @Gedmo\Blameable(on="update") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $updatedBy; | |||
public function getCreatedBy(): ?UserInterface | |||
{ | |||
return $this->createdBy; | |||
} | |||
public function setCreatedBy(?UserInterface $createdBy): self | |||
{ | |||
$this->createdBy = $createdBy; | |||
return $this; | |||
} | |||
public function getUpdatedBy(): ?UserInterface | |||
{ | |||
return $this->updatedBy; | |||
} | |||
public function setUpdatedBy(?UserInterface $updatedBy): self | |||
{ | |||
$this->updatedBy = $updatedBy; | |||
return $this; | |||
} | |||
} |
@@ -4,6 +4,8 @@ namespace Lc\SovBundle\Model\Site; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Gedmo\Mapping\Annotation as Gedmo; | |||
use Lc\SovBundle\Doctrine\Extension\OpenGraphInterface; | |||
use Lc\SovBundle\Doctrine\Extension\OpenGraphTrait; | |||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||
use Lc\SovBundle\Model\File\FileInterface; | |||
use Lc\SovBundle\Model\Newsletter\NewsletterInterface; | |||
@@ -11,9 +13,11 @@ use Lc\SovBundle\Model\Newsletter\NewsletterInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class NewsModel extends AbstractFullEntity implements NewsInterface | |||
abstract class NewsModel extends AbstractFullEntity implements NewsInterface, OpenGraphInterface | |||
{ | |||
use OpenGraphTrait; | |||
/** | |||
* @ORM\Column(type="datetime") | |||
* @Gedmo\Timestampable(on="create") |
@@ -16,7 +16,7 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | |||
abstract class TicketMessageModel extends AbstractLightEntity implements TicketMessageInterface, EntityInterface, StatusInterface | |||
{ | |||
use StatusTrait; | |||
use BlameableNullableTrait; | |||
/** | |||
* @ORM\Column(type="text") |
@@ -16,7 +16,7 @@ use Lc\SovBundle\Model\User\UserInterface; | |||
*/ | |||
abstract class TicketModel extends AbstractLightEntity implements TicketInterface, EntityInterface | |||
{ | |||
use BlameableNullableTrait; | |||
const TYPE_TECHNICAL_PROBLEM = 'technical-problem'; |
@@ -6,19 +6,15 @@ use Doctrine\ORM\Mapping as ORM; | |||
use Doctrine\Common\Collections\ArrayCollection; | |||
use Doctrine\Common\Collections\Collection; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class GroupUserModel extends AbstractLightEntity implements GroupUserInterface, EntityInterface | |||
abstract class GroupUserModel extends AbstractFullEntity implements GroupUserInterface, EntityInterface | |||
{ | |||
/** | |||
* @ORM\Column(type="string", length=255) | |||
*/ | |||
protected $title; | |||
/** | |||
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="groupUsers") | |||
*/ |