Browse Source

Script import v1

develop
Fab 3 years ago
parent
commit
c4723879aa
6 changed files with 47 additions and 74 deletions
  1. +0
    -27
      Doctrine/Extension/BlameableNullableTrait.php
  2. +38
    -38
      Doctrine/Extension/BlameableTrait.php
  3. +5
    -1
      Model/Site/NewsModel.php
  4. +1
    -1
      Model/Ticket/TicketMessageModel.php
  5. +1
    -1
      Model/Ticket/TicketModel.php
  6. +2
    -6
      Model/User/GroupUserModel.php

+ 0
- 27
Doctrine/Extension/BlameableNullableTrait.php View File

<?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;


}

+ 38
- 38
Doctrine/Extension/BlameableTrait.php View File

trait BlameableTrait 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;
}


} }

+ 5
- 1
Model/Site/NewsModel.php View File



use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; 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\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Model\File\FileInterface; use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\Newsletter\NewsletterInterface; use Lc\SovBundle\Model\Newsletter\NewsletterInterface;
/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class NewsModel extends AbstractFullEntity implements NewsInterface
abstract class NewsModel extends AbstractFullEntity implements NewsInterface, OpenGraphInterface
{ {


use OpenGraphTrait;

/** /**
* @ORM\Column(type="datetime") * @ORM\Column(type="datetime")
* @Gedmo\Timestampable(on="create") * @Gedmo\Timestampable(on="create")

+ 1
- 1
Model/Ticket/TicketMessageModel.php View File

abstract class TicketMessageModel extends AbstractLightEntity implements TicketMessageInterface, EntityInterface, StatusInterface abstract class TicketMessageModel extends AbstractLightEntity implements TicketMessageInterface, EntityInterface, StatusInterface
{ {
use StatusTrait; use StatusTrait;
use BlameableNullableTrait;


/** /**
* @ORM\Column(type="text") * @ORM\Column(type="text")

+ 1
- 1
Model/Ticket/TicketModel.php View File

*/ */
abstract class TicketModel extends AbstractLightEntity implements TicketInterface, EntityInterface abstract class TicketModel extends AbstractLightEntity implements TicketInterface, EntityInterface
{ {
use BlameableNullableTrait;




const TYPE_TECHNICAL_PROBLEM = 'technical-problem'; const TYPE_TECHNICAL_PROBLEM = 'technical-problem';

+ 2
- 6
Model/User/GroupUserModel.php View File

use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Lc\SovBundle\Doctrine\EntityInterface; use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;


/** /**
* @ORM\MappedSuperclass() * @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") * @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="groupUsers")
*/ */

Loading…
Cancel
Save