@@ -2,7 +2,6 @@ | |||
namespace Lc\SovBundle\Controller\Admin; | |||
use App\Entity\Page; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\Action; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets; |
@@ -2,8 +2,6 @@ | |||
namespace Lc\SovBundle\Controller\Admin; | |||
use App\Entity\Page; | |||
use App\Entity\User; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem; |
@@ -11,14 +11,14 @@ trait BlameableTrait | |||
/** | |||
* @Gedmo\Blameable(on="create") | |||
* @ORM\ManyToOne(targetEntity="App\Entity\User") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $createdBy; | |||
/** | |||
* @Gedmo\Blameable(on="update") | |||
* @ORM\ManyToOne(targetEntity="App\Entity\User") | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $updatedBy; |
@@ -19,7 +19,7 @@ trait OpenGraphTrait | |||
protected $openGraphDescription; | |||
/** | |||
* @ORM\ManyToOne(targetEntity=FileInterface::class, cascade={"persist", "remove"}) | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"}) | |||
*/ | |||
protected $openGraphImage; | |||
@@ -6,58 +6,58 @@ use Doctrine\ORM\Mapping as ORM; | |||
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; | |||
} | |||
} |
@@ -7,21 +7,21 @@ use Gedmo\Mapping\Annotation as Gedmo; | |||
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; | |||
} | |||
} |
@@ -8,27 +8,27 @@ use Gedmo\Mapping\Annotation as Gedmo; | |||
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; | |||
} | |||
} |
@@ -6,20 +6,20 @@ use Doctrine\ORM\Mapping as ORM; | |||
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; | |||
} | |||
} |
@@ -7,40 +7,40 @@ use Gedmo\Mapping\Annotation as Gedmo; | |||
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; | |||
} | |||
} |
@@ -7,42 +7,41 @@ use Gedmo\Mapping\Annotation as Gedmo; | |||
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; | |||
} | |||
} |
@@ -24,8 +24,8 @@ use Lc\SovBundle\Doctrine\Extension\TimestampableTrait; | |||
/** | |||
* @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; |
@@ -16,7 +16,7 @@ use Lc\SovBundle\Doctrine\Extension\TimestampableTrait; | |||
/** | |||
* @ORM\MappedSuperclass | |||
*/ | |||
abstract class EntityLightAbstract implements BlameableInterface, TimestampableInterface, DevAliasInterface, | |||
abstract class AbstractLightEntity implements BlameableInterface, TimestampableInterface, DevAliasInterface, | |||
EntityInterface | |||
{ | |||
@@ -11,8 +11,8 @@ use Doctrine\ORM\QueryBuilder; | |||
use Gedmo\Translatable\TranslatableListener; | |||
use Lc\SovBundle\Doctrine\Extension\StatusInterface; | |||
abstract class RepositoryAbstract extends EntityRepository implements ServiceEntityRepositoryInterface, | |||
RepositoryAbstractInterface | |||
abstract class AbstractRepository extends EntityRepository implements ServiceEntityRepositoryInterface, | |||
AbstractRepositoryInterface | |||
{ | |||
protected $defaultLocale; |
@@ -3,7 +3,7 @@ | |||
namespace Lc\SovBundle\Repository; | |||
interface RepositoryAbstractInterface | |||
interface AbstractRepositoryInterface | |||
{ | |||
/** |
@@ -2,9 +2,6 @@ | |||
namespace Lc\SovBundle\Twig; | |||
use App\Entity\Page; | |||
use Doctrine\ORM\EntityManagerInterface; | |||
use Liip\ImagineBundle\Imagine\Cache\CacheManager; | |||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; |