namespace Lc\SovBundle\Controller\Admin; | namespace Lc\SovBundle\Controller\Admin; | ||||
use App\Entity\Page; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Action; | use EasyCorp\Bundle\EasyAdminBundle\Config\Action; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets; | use EasyCorp\Bundle\EasyAdminBundle\Config\Assets; |
namespace Lc\SovBundle\Controller\Admin; | namespace Lc\SovBundle\Controller\Admin; | ||||
use App\Entity\Page; | |||||
use App\Entity\User; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard; | use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem; | use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem; |
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="App\Entity\User") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="App\Entity\User") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
protected $openGraphDescription; | protected $openGraphDescription; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity=FileInterface::class, cascade={"persist", "remove"}) | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
protected $openGraphImage; | protected $openGraphImage; | ||||
trait SeoTrait | trait SeoTrait | ||||
{ | { | ||||
/** | |||||
* @ORM\Column(type="string", length=255, nullable=true) | |||||
*/ | |||||
protected $metaTitle; | |||||
/** | |||||
* @ORM\Column(type="string", length=255, nullable=true) | |||||
*/ | |||||
protected $metaTitle; | |||||
/** | |||||
* @ORM\Column(type="text", nullable=true) | |||||
*/ | |||||
protected $metaDescription; | |||||
/** | |||||
* @ORM\Column(type="text", nullable=true) | |||||
*/ | |||||
protected $metaDescription; | |||||
/** | |||||
* @var array | |||||
* @ORM\Column(type="array", nullable=true) | |||||
*/ | |||||
protected $oldUrls; | |||||
/** | |||||
* @var array | |||||
* @ORM\Column(type="array", nullable=true) | |||||
*/ | |||||
protected $oldUrls; | |||||
public function getMetaTitle(): ?string | |||||
{ | |||||
return $this->metaTitle; | |||||
} | |||||
public function getMetaTitle(): ?string | |||||
{ | |||||
return $this->metaTitle; | |||||
} | |||||
public function setMetaTitle(?string $metaTitle): self | |||||
{ | |||||
$this->metaTitle = $metaTitle; | |||||
public function setMetaTitle(?string $metaTitle): self | |||||
{ | |||||
$this->metaTitle = $metaTitle; | |||||
return $this; | |||||
} | |||||
return $this; | |||||
} | |||||
public function getMetaDescription(): ?string | |||||
{ | |||||
return $this->metaDescription; | |||||
} | |||||
public function getMetaDescription(): ?string | |||||
{ | |||||
return $this->metaDescription; | |||||
} | |||||
public function setMetaDescription(?string $metaDescription): self | |||||
{ | |||||
$this->metaDescription = $metaDescription; | |||||
public function setMetaDescription(?string $metaDescription): self | |||||
{ | |||||
$this->metaDescription = $metaDescription; | |||||
return $this; | |||||
} | |||||
return $this; | |||||
} | |||||
public function setOldUrls($oldUrls): self | |||||
{ | |||||
$this->oldUrls = $oldUrls; | |||||
public function setOldUrls($oldUrls): self | |||||
{ | |||||
$this->oldUrls = $oldUrls; | |||||
return $this; | |||||
} | |||||
return $this; | |||||
} | |||||
public function getOldUrls(): ?array | |||||
{ | |||||
return $this->oldUrls; | |||||
} | |||||
public function getOldUrls(): ?array | |||||
{ | |||||
return $this->oldUrls; | |||||
} | |||||
} | } |
trait SluggableTrait | trait SluggableTrait | ||||
{ | { | ||||
/** | |||||
* @ORM\Column(type="string", length=255) | |||||
* @Gedmo\Slug(fields={"title"}) | |||||
*/ | |||||
protected $slug; | |||||
/** | |||||
* @ORM\Column(type="string", length=255) | |||||
* @Gedmo\Slug(fields={"title"}) | |||||
*/ | |||||
protected $slug; | |||||
public function getSlug(): ?string | |||||
{ | |||||
return $this->slug; | |||||
} | |||||
public function getSlug(): ?string | |||||
{ | |||||
return $this->slug; | |||||
} | |||||
public function setSlug(?string $slug): self | |||||
{ | |||||
$this->slug = $slug; | |||||
public function setSlug(?string $slug): self | |||||
{ | |||||
$this->slug = $slug; | |||||
return $this; | |||||
} | |||||
return $this; | |||||
} | |||||
} | } |
trait SortableTrait | trait SortableTrait | ||||
{ | { | ||||
/** | |||||
* @var string | |||||
* @ORM\Column(type="float") | |||||
*/ | |||||
protected $position = 0; | |||||
/** | |||||
* @var string | |||||
* @ORM\Column(type="float") | |||||
*/ | |||||
protected $position = 0; | |||||
/** | |||||
* @return float | |||||
*/ | |||||
public function getPosition(): float | |||||
{ | |||||
return $this->position; | |||||
} | |||||
/** | |||||
* @return float | |||||
*/ | |||||
public function getPosition(): float | |||||
{ | |||||
return $this->position; | |||||
} | |||||
/** | |||||
* @param float $position | |||||
* @return $this | |||||
*/ | |||||
public function setPosition(float $position): self | |||||
{ | |||||
$this->position = $position; | |||||
return $this; | |||||
} | |||||
/** | |||||
* @param float $position | |||||
* @return $this | |||||
*/ | |||||
public function setPosition(float $position): self | |||||
{ | |||||
$this->position = $position; | |||||
return $this; | |||||
} | |||||
} | } |
trait StatusTrait | trait StatusTrait | ||||
{ | { | ||||
/** | |||||
* @ORM\Column(type="float") | |||||
*/ | |||||
protected $status; | |||||
/** | |||||
* @ORM\Column(type="float") | |||||
*/ | |||||
protected $status; | |||||
public function getStatus(): ?float | |||||
{ | |||||
return $this->status; | |||||
} | |||||
public function getStatus(): ?float | |||||
{ | |||||
return $this->status; | |||||
} | |||||
public function setStatus(float $status): self | |||||
{ | |||||
$this->status = $status; | |||||
public function setStatus(float $status): self | |||||
{ | |||||
$this->status = $status; | |||||
return $this; | |||||
} | |||||
return $this; | |||||
} | |||||
} | } |
trait TimestampableTrait | trait TimestampableTrait | ||||
{ | { | ||||
/** | |||||
* @ORM\Column(type="datetime") | |||||
* @Gedmo\Timestampable(on="create") | |||||
*/ | |||||
protected $createdAt; | |||||
/** | |||||
* @ORM\Column(type="datetime") | |||||
* @Gedmo\Timestampable(on="update") | |||||
*/ | |||||
protected $updatedAt; | |||||
public function getCreatedAt(): ?\DateTimeInterface | |||||
{ | |||||
return $this->createdAt; | |||||
} | |||||
public function setCreatedAt(\DateTimeInterface $createdAt): self | |||||
{ | |||||
$this->createdAt = $createdAt; | |||||
return $this; | |||||
} | |||||
public function getUpdatedAt(): ?\DateTimeInterface | |||||
{ | |||||
return $this->updatedAt; | |||||
} | |||||
public function setUpdatedAt(\DateTimeInterface $updatedAt): self | |||||
{ | |||||
$this->updatedAt = $updatedAt; | |||||
return $this; | |||||
} | |||||
/** | |||||
* @ORM\Column(type="datetime") | |||||
* @Gedmo\Timestampable(on="create") | |||||
*/ | |||||
protected $createdAt; | |||||
/** | |||||
* @ORM\Column(type="datetime") | |||||
* @Gedmo\Timestampable(on="update") | |||||
*/ | |||||
protected $updatedAt; | |||||
public function getCreatedAt(): ?\DateTimeInterface | |||||
{ | |||||
return $this->createdAt; | |||||
} | |||||
public function setCreatedAt(\DateTimeInterface $createdAt): self | |||||
{ | |||||
$this->createdAt = $createdAt; | |||||
return $this; | |||||
} | |||||
public function getUpdatedAt(): ?\DateTimeInterface | |||||
{ | |||||
return $this->updatedAt; | |||||
} | |||||
public function setUpdatedAt(\DateTimeInterface $updatedAt): self | |||||
{ | |||||
$this->updatedAt = $updatedAt; | |||||
return $this; | |||||
} | |||||
} | } |
trait TranslatableTrait | trait TranslatableTrait | ||||
{ | { | ||||
/** | |||||
* Post locale | |||||
* Used locale to override Translation listener's locale | |||||
* @Gedmo\Locale | |||||
*/ | |||||
protected $locale; | |||||
/** | |||||
* @ORM\Column(type="array", nullable=true) | |||||
*/ | |||||
protected $localesEnabled = []; | |||||
public function __get($name) | |||||
{ | |||||
if(isset($this->{$name})) { | |||||
return $this->{$name}; | |||||
}else{ | |||||
return null; | |||||
} | |||||
/** | |||||
* Post locale | |||||
* Used locale to override Translation listener's locale | |||||
* @Gedmo\Locale | |||||
*/ | |||||
protected $locale; | |||||
/** | |||||
* @ORM\Column(type="array", nullable=true) | |||||
*/ | |||||
protected $localesEnabled = []; | |||||
public function __get($name) | |||||
{ | |||||
if (isset($this->{$name})) { | |||||
return $this->{$name}; | |||||
} else { | |||||
return null; | |||||
} | } | ||||
} | |||||
public function setTranslatableLocale($locale) | |||||
{ | |||||
$this->locale = $locale; | |||||
} | |||||
public function setTranslatableLocale($locale) | |||||
{ | |||||
$this->locale = $locale; | |||||
} | |||||
public function getLocalesEnabled(): ?array | |||||
{ | |||||
return $this->localesEnabled; | |||||
} | |||||
public function getLocalesEnabled(): ?array | |||||
{ | |||||
return $this->localesEnabled; | |||||
} | |||||
public function setLocalesEnabled(?array $localesEnabled): self | |||||
{ | |||||
$this->localesEnabled = $localesEnabled; | |||||
public function setLocalesEnabled(?array $localesEnabled): self | |||||
{ | |||||
$this->localesEnabled = $localesEnabled; | |||||
return $this; | |||||
} | |||||
return $this; | |||||
} | |||||
} | } |
/** | /** | ||||
* @ORM\MappedSuperclass | * @ORM\MappedSuperclass | ||||
*/ | */ | ||||
abstract class EntityFullAbstract implements BlameableInterface, SeoInterface, SluggableInterface, SortableInterface, | |||||
StatusInterface, TimestampableInterface, DevAliasInterface, EntityInterface | |||||
abstract class AbstractFullEntity implements BlameableInterface, SeoInterface, SluggableInterface, SortableInterface, | |||||
StatusInterface, TimestampableInterface, DevAliasInterface, EntityInterface | |||||
{ | { | ||||
use BlameableTrait; | use BlameableTrait; |
/** | /** | ||||
* @ORM\MappedSuperclass | * @ORM\MappedSuperclass | ||||
*/ | */ | ||||
abstract class EntityLightAbstract implements BlameableInterface, TimestampableInterface, DevAliasInterface, | |||||
abstract class AbstractLightEntity implements BlameableInterface, TimestampableInterface, DevAliasInterface, | |||||
EntityInterface | EntityInterface | ||||
{ | { | ||||
use Gedmo\Translatable\TranslatableListener; | use Gedmo\Translatable\TranslatableListener; | ||||
use Lc\SovBundle\Doctrine\Extension\StatusInterface; | use Lc\SovBundle\Doctrine\Extension\StatusInterface; | ||||
abstract class RepositoryAbstract extends EntityRepository implements ServiceEntityRepositoryInterface, | |||||
RepositoryAbstractInterface | |||||
abstract class AbstractRepository extends EntityRepository implements ServiceEntityRepositoryInterface, | |||||
AbstractRepositoryInterface | |||||
{ | { | ||||
protected $defaultLocale; | protected $defaultLocale; |
namespace Lc\SovBundle\Repository; | namespace Lc\SovBundle\Repository; | ||||
interface RepositoryAbstractInterface | |||||
interface AbstractRepositoryInterface | |||||
{ | { | ||||
/** | /** |
namespace Lc\SovBundle\Twig; | namespace Lc\SovBundle\Twig; | ||||
use App\Entity\Page; | |||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use Liip\ImagineBundle\Imagine\Cache\CacheManager; | use Liip\ImagineBundle\Imagine\Cache\CacheManager; | ||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; |