namespace Lc\SovBundle\Authenticator; | namespace Lc\SovBundle\Authenticator; | ||||
use Lc\SovBundle\IModel\User\UserInterface; | |||||
use Lc\SovBundle\Manager\EntityManager; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
use Lc\SovBundle\Doctrine\EntityManager; | |||||
use Symfony\Component\HttpFoundation\RedirectResponse; | use Symfony\Component\HttpFoundation\RedirectResponse; | ||||
use Symfony\Component\HttpFoundation\Request; | use Symfony\Component\HttpFoundation\Request; | ||||
use Symfony\Component\Security\Core\User\UserInterface as SfUserInterface; | use Symfony\Component\Security\Core\User\UserInterface as SfUserInterface; |
namespace Lc\SovBundle\Command; | namespace Lc\SovBundle\Command; | ||||
use Lc\SovBundle\IModel\User\UserInterface; | |||||
use Lc\SovBundle\Manager\EntityManager; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
use Lc\SovBundle\Doctrine\EntityManager; | |||||
use Symfony\Component\Console\Command\Command; | use Symfony\Component\Console\Command\Command; | ||||
use Symfony\Component\Console\Input\InputArgument; | use Symfony\Component\Console\Input\InputArgument; | ||||
use Symfony\Component\Console\Input\InputInterface; | use Symfony\Component\Console\Input\InputInterface; |
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController as EaAbstractCrudController; | use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController as EaAbstractCrudController; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | ||||
use Lc\SovBundle\IModel\Translation\TranslatableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\TranslatableInterface; | |||||
abstract class AbstractCrudController extends EaAbstractCrudController | abstract class AbstractCrudController extends EaAbstractCrudController | ||||
{ | { |
<?php | <?php | ||||
namespace Lc\SovBundle\IModel; | |||||
namespace Lc\SovBundle\Doctrine; | |||||
interface EntityInterface | interface EntityInterface | ||||
{ | { |
<?php | <?php | ||||
namespace Lc\SovBundle\Manager; | |||||
namespace Lc\SovBundle\Doctrine; | |||||
use Doctrine\ORM\EntityManager as DoctrineEntityManager; | use Doctrine\ORM\EntityManager as DoctrineEntityManager; | ||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; |
<?php | <?php | ||||
namespace Lc\SovBundle\IModel\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface BlameableInterface | interface BlameableInterface | ||||
{ | { |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
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\IModel\User\UserInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
trait BlameableTrait | trait BlameableTrait | ||||
{ | { |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface DevAliasInterface | |||||
{ | |||||
} |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\Common\Collections\ArrayCollection; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
trait DevAliasTrait | trait DevAliasTrait |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface OpenGraphInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Lc\SovBundle\Model\File\File; | |||||
use Lc\SovBundle\Model\File\FileInterface; | |||||
trait OpenGraphTrait | |||||
{ | |||||
/** | |||||
* @ORM\Column(type="string", nullable=true) | |||||
*/ | |||||
protected $openGraphTitle; | |||||
/** | |||||
* @ORM\Column(type="text", nullable=true) | |||||
*/ | |||||
protected $openGraphDescription; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity=FileInterface::class, cascade={"persist", "remove"}) | |||||
*/ | |||||
protected $openGraphImage; | |||||
public function getOpenGraphTitle(): ?string | |||||
{ | |||||
return $this->openGraphTitle; | |||||
} | |||||
public function setOpenGraphTitle(string $openGraphTitle): self | |||||
{ | |||||
$this->openGraphTitle = $openGraphTitle; | |||||
return $this; | |||||
} | |||||
public function getOpenGraphDescription(): ?string | |||||
{ | |||||
return $this->openGraphDescription; | |||||
} | |||||
public function setOpenGraphDescription(?string $openGraphDescription): self | |||||
{ | |||||
$this->openGraphDescription = $openGraphDescription; | |||||
return $this; | |||||
} | |||||
public function getOpenGraphImage(): ?File | |||||
{ | |||||
return $this->openGraphImage; | |||||
} | |||||
public function setOpenGraphImage(?File $openGraphImage): self | |||||
{ | |||||
$this->openGraphImage = $openGraphImage; | |||||
return $this; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface SeoInterface | |||||
{ | |||||
} |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
<?php | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface SluggableInterface | |||||
{ | |||||
} |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Gedmo\Mapping\Annotation as Gedmo; | use Gedmo\Mapping\Annotation as Gedmo; |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface SortableInterface | |||||
{ | |||||
} |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Gedmo\Mapping\Annotation as Gedmo; | use Gedmo\Mapping\Annotation as Gedmo; |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface StatusInterface | |||||
{ | |||||
} |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
<?php | <?php | ||||
namespace Lc\SovBundle\IModel\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface TimestampableInterface | interface TimestampableInterface | ||||
{ | { |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Gedmo\Mapping\Annotation as Gedmo; | use Gedmo\Mapping\Annotation as Gedmo; |
<?php | <?php | ||||
namespace Lc\SovBundle\IModel\Translation; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface TranslatableInterface | interface TranslatableInterface | ||||
{ | { |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Translation; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
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\Entity\Translation\EntityTranslation; | |||||
/** | |||||
* @Gedmo\TranslationEntity(class=EntityTranslation::class) | |||||
*/ | |||||
trait TranslatableTrait | trait TranslatableTrait | ||||
{ | { | ||||
/** | /** |
<?php | <?php | ||||
namespace Lc\SovBundle\IModel\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
interface TreeInterface | interface TreeInterface | ||||
{ | { |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Doctrine\Extension; | |||||
use Doctrine\Common\Collections\ArrayCollection; | use Doctrine\Common\Collections\ArrayCollection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Pattern; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\SeoInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\SeoTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\SluggableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\SluggableTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\SortableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\SortableTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\StatusTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\TimestampableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\StatusInterface; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Gedmo\Mapping\Annotation as Gedmo; | |||||
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait; | |||||
/** | |||||
* @ORM\MappedSuperclass | |||||
*/ | |||||
abstract class EntityFullAbstract implements BlameableInterface, SeoInterface, SluggableInterface, SortableInterface, | |||||
StatusInterface, TimestampableInterface, DevAliasInterface, EntityInterface | |||||
{ | |||||
use BlameableTrait; | |||||
use SeoTrait; | |||||
use SluggableTrait; | |||||
use SortableTrait; | |||||
use StatusTrait; | |||||
use TimestampableTrait; | |||||
use DevAliasTrait; | |||||
/** | |||||
* @Gedmo\Translatable | |||||
* @ORM\Column(type="string", length=255) | |||||
*/ | |||||
protected $title; | |||||
/** | |||||
* @Gedmo\Translatable | |||||
* @ORM\Column(type="text", nullable=true) | |||||
*/ | |||||
protected $description; | |||||
public function getTitle(): ?string | |||||
{ | |||||
return $this->title; | |||||
} | |||||
public function setTitle(string $title): self | |||||
{ | |||||
$this->title = $title; | |||||
return $this; | |||||
} | |||||
public function getDescription(): ?string | |||||
{ | |||||
return $this->description; | |||||
} | |||||
public function setDescription(?string $description): self | |||||
{ | |||||
$this->description = $description; | |||||
return $this; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Doctrine\Pattern; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\TimestampableInterface; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Gedmo\Mapping\Annotation as Gedmo; | |||||
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait; | |||||
/** | |||||
* @ORM\MappedSuperclass | |||||
*/ | |||||
abstract class EntityLightAbstract implements BlameableInterface, TimestampableInterface, DevAliasInterface, | |||||
EntityInterface | |||||
{ | |||||
use BlameableTrait; | |||||
use DevAliasTrait; | |||||
use TimestampableTrait; | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Entity\Translation; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation; | |||||
/** | |||||
* @ORM\Table(name="lc_translations_entity", indexes={ | |||||
* @ORM\Index(name="entity_translation_idx", columns={"locale", "object_class", "field", "foreign_key"}) | |||||
* }) | |||||
* @ORM\Entity(repositoryClass="Lc\SovBundle\Repository\BaseRepository") | |||||
*/ | |||||
class EntityTranslation extends AbstractTranslation | |||||
{ | |||||
//put your code here | |||||
} |
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeCrudActionEvent; | use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeCrudActionEvent; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeEntityPersistedEvent; | use EasyCorp\Bundle\EasyAdminBundle\Event\BeforeEntityPersistedEvent; | ||||
use Gedmo\Translatable\TranslatableListener; | use Gedmo\Translatable\TranslatableListener; | ||||
use Lc\SovBundle\IModel\Translation\TranslatableInterface; | |||||
use Lc\SovBundle\Manager\EntityManager; | |||||
use Lc\SovBundle\Doctrine\Extension\TranslatableInterface; | |||||
use Lc\SovBundle\Doctrine\EntityManager; | |||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||||
use function Symfony\Component\Translation\t; | use function Symfony\Component\Translation\t; | ||||
use Lc\SovBundle\DataTransformer\FileManagerTypeToDataTransformer; | use Lc\SovBundle\DataTransformer\FileManagerTypeToDataTransformer; | ||||
use Lc\SovBundle\Entity\File\File; | use Lc\SovBundle\Entity\File\File; | ||||
use Lc\SovBundle\IModel\Cms\FileInterface; | |||||
use Lc\SovBundle\Manager\EntityManager; | |||||
use Lc\SovBundle\Doctrine\Extension\FileInterface; | |||||
use Lc\SovBundle\Doctrine\EntityManager; | |||||
use Symfony\Component\Form\AbstractType; | use Symfony\Component\Form\AbstractType; | ||||
use Symfony\Component\Form\DataTransformerInterface; | use Symfony\Component\Form\DataTransformerInterface; | ||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType; | use Symfony\Component\Form\Extension\Core\Type\HiddenType; |
<?php | |||||
namespace Lc\SovBundle\IModel\Cms; | |||||
interface DevAliasInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\IModel\Cms; | |||||
interface SeoInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\IModel\Cms; | |||||
interface SluggableInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\IModel\Cms; | |||||
interface SortableInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\IModel\Cms; | |||||
interface StatusInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Model\Cms; | |||||
use Lc\SovBundle\IModel\Cms\BlameableInterface; | |||||
use Lc\SovBundle\IModel\Cms\DevAliasInterface; | |||||
use Lc\SovBundle\IModel\Cms\SeoInterface; | |||||
use Lc\SovBundle\IModel\Cms\SluggableInterface; | |||||
use Lc\SovBundle\IModel\Cms\SortableInterface; | |||||
use Lc\SovBundle\IModel\Cms\TimestampableInterface; | |||||
use Lc\SovBundle\IModel\Cms\StatusInterface; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Gedmo\Mapping\Annotation as Gedmo; | |||||
use Lc\SovBundle\IModel\EntityInterface; | |||||
/** | |||||
* @ORM\MappedSuperclass | |||||
*/ | |||||
abstract class AbstractDocument implements BlameableInterface, SeoInterface, SluggableInterface, SortableInterface, StatusInterface, TimestampableInterface, DevAliasInterface, EntityInterface | |||||
{ | |||||
use BlameableTrait; | |||||
use SeoTrait; | |||||
use SluggableTrait; | |||||
use SortableTrait; | |||||
use StatusTrait; | |||||
use TimestampableTrait; | |||||
use DevAliasTrait; | |||||
/** | |||||
* @Gedmo\Translatable | |||||
* @ORM\Column(type="string", length=255) | |||||
*/ | |||||
protected $title; | |||||
/** | |||||
* @Gedmo\Translatable | |||||
* @ORM\Column(type="text", nullable=true) | |||||
*/ | |||||
protected $description; | |||||
public function getTitle(): ?string | |||||
{ | |||||
return $this->title; | |||||
} | |||||
public function setTitle(string $title): self | |||||
{ | |||||
$this->title = $title; | |||||
return $this; | |||||
} | |||||
public function getDescription(): ?string | |||||
{ | |||||
return $this->description; | |||||
} | |||||
public function setDescription(?string $description): self | |||||
{ | |||||
$this->description = $description; | |||||
return $this; | |||||
} | |||||
} |
<?php | <?php | ||||
namespace Lc\SovBundle\Model\Cms; | |||||
namespace Lc\SovBundle\Model\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\IModel\Cms\BlameableInterface; | |||||
use Lc\SovBundle\IModel\Cms\DevAliasInterface; | |||||
use Lc\SovBundle\IModel\Cms\SortableInterface; | |||||
use Lc\SovBundle\IModel\Cms\TimestampableInterface; | |||||
use Lc\SovBundle\IModel\EntityInterface; | |||||
use Lc\SovBundle\IModel\Translation\TranslatableInterface; | |||||
use Lc\SovBundle\Model\Cms\BlameableTrait; | |||||
use Lc\SovBundle\Model\Cms\DevAliasTrait; | |||||
use Lc\SovBundle\Model\Cms\SortableTrait; | |||||
use Lc\SovBundle\Model\Cms\TimestampableTrait; | |||||
use Lc\SovBundle\Model\Translation\TranslatableTrait; | |||||
use Lc\SovBundle\Entity\Translation\EntityTranslation; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\SortableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\SortableTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\TimestampableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait; | |||||
use Lc\SovBundle\Doctrine\Extension\TranslatableInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\TranslatableTrait; | |||||
/** | |||||
* @Gedmo\TranslationEntity (class=EntityTranslation::class) | |||||
*/ | |||||
abstract class File implements SortableInterface, BlameableInterface, TimestampableInterface, TranslatableInterface, DevAliasInterface, EntityInterface | |||||
abstract class File implements SortableInterface, BlameableInterface, TimestampableInterface, TranslatableInterface, | |||||
DevAliasInterface, EntityInterface | |||||
{ | { | ||||
use DevAliasTrait; | use DevAliasTrait; | ||||
use BlameableTrait; | use BlameableTrait; |
<?php | <?php | ||||
namespace Lc\SovBundle\IModel\Cms; | |||||
namespace Lc\SovBundle\Model\File; | |||||
interface FileInterface | interface FileInterface | ||||
{ | { |
namespace Lc\SovBundle\Model\User; | namespace Lc\SovBundle\Model\User; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\IModel\EntityInterface; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Symfony\Component\Security\Core\User\UserInterface; | use Symfony\Component\Security\Core\User\UserInterface; | ||||
/** | /** |
<?php | <?php | ||||
namespace Lc\SovBundle\IModel\User; | |||||
namespace Lc\SovBundle\Model\User; | |||||
interface UserInterface | interface UserInterface | ||||
{ | { |
orm: | orm: | ||||
resolve_target_entities: | resolve_target_entities: | ||||
Lc\SovBundle\IModel\User\UserInterface: App\Entity\User | Lc\SovBundle\IModel\User\UserInterface: App\Entity\User | ||||
Lc\SovBundle\IModel\Cms\FileInterface: App\Entity\File | |||||
Lc\SovBundle\Doctrine\Extension\FileInterface: App\Entity\File | |||||
#... | #... | ||||
``` | ``` | ||||
namespace App\Entity; | namespace App\Entity; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\IModel\User\UserInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | ||||
use Lc\SovBundle\Model\User\User as LcUserModel; | use Lc\SovBundle\Model\User\User as LcUserModel; | ||||
```` | ```` | ||||
- Modifier les entités pour que les Use pointe dans AdminBundle exemple avec `Entity/Page.php`. | - Modifier les entités pour que les Use pointe dans AdminBundle exemple avec `Entity/Page.php`. | ||||
```` | ```` | ||||
use Lc\SovBundle\IModel\Cms\ImageInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\ImageInterface; | |||||
use Lc\SovBundle\Model\Cms\AbstractDocument; | use Lc\SovBundle\Model\Cms\AbstractDocument; | ||||
use Lc\SovBundle\Model\Cms\ImageTrait; | use Lc\SovBundle\Model\Cms\ImageTrait; | ||||
namespace App\Repository; | namespace App\Repository; | ||||
use App\Entity\Page; | use App\Entity\Page; | ||||
use Lc\SovBundle\Repository\BaseRepository; | |||||
use Lc\SovBundle\Repository\RepositoryAbstract; | |||||
/** | /** | ||||
* @method Page|null find($id, $lockMode = null, $lockVersion = null) | * @method Page|null find($id, $lockMode = null, $lockVersion = null) | ||||
* @method Page[] findAll() | * @method Page[] findAll() | ||||
* @method Page[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | * @method Page[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | ||||
*/ | */ | ||||
class PageRepository extends BaseRepository | |||||
class PageRepository extends RepositoryAbstract | |||||
{ | { | ||||
public function getInterfaceClass() | public function getInterfaceClass() | ||||
{ | { |
<?php | <?php | ||||
namespace Lc\SovBundle\Repository\Cms; | |||||
namespace Lc\SovBundle\Repository\File; | |||||
use Lc\SovBundle\IModel\Cms\FileInterface; | |||||
use Lc\SovBundle\Repository\BaseRepository; | |||||
use Lc\SovBundle\Doctrine\Extension\FileInterface; | |||||
use Lc\SovBundle\Repository\RepositoryAbstract; | |||||
/** | /** | ||||
* @method FileInterface|null find($id, $lockMode = null, $lockVersion = null) | * @method FileInterface|null find($id, $lockMode = null, $lockVersion = null) | ||||
* @method FileInterface|null findOneBy(array $criteria, array $orderBy = null) | * @method FileInterface|null findOneBy(array $criteria, array $orderBy = null) | ||||
* @method FileInterface[] findAll() | * @method FileInterface[] findAll() | ||||
* @method FileInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | * @method FileInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | ||||
*/ | */ | ||||
class FileRepository extends BaseRepository | |||||
class FileRepository extends RepositoryAbstract | |||||
{ | { | ||||
public function getInterfaceClass() | public function getInterfaceClass() | ||||
{ | { |
use Doctrine\ORM\Query; | use Doctrine\ORM\Query; | ||||
use Doctrine\ORM\QueryBuilder; | use Doctrine\ORM\QueryBuilder; | ||||
use Gedmo\Translatable\TranslatableListener; | use Gedmo\Translatable\TranslatableListener; | ||||
use Lc\SovBundle\IModel\Cms\StatusInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\StatusInterface; | |||||
abstract class BaseRepository extends EntityRepository implements ServiceEntityRepositoryInterface, BaseRepositoryInterface | |||||
abstract class RepositoryAbstract extends EntityRepository implements ServiceEntityRepositoryInterface, | |||||
RepositoryAbstractInterface | |||||
{ | { | ||||
protected $defaultLocale; | protected $defaultLocale; |
namespace Lc\SovBundle\Repository; | namespace Lc\SovBundle\Repository; | ||||
interface BaseRepositoryInterface | |||||
interface RepositoryAbstractInterface | |||||
{ | { | ||||
/** | /** |
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | ||||
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\IModel\User\UserInterface; | |||||
use Lc\SovBundle\Repository\BaseRepository; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
use Lc\SovBundle\Repository\RepositoryAbstract; | |||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException; | use Symfony\Component\Security\Core\Exception\UnsupportedUserException; | ||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface; | use Symfony\Component\Security\Core\User\PasswordUpgraderInterface; | ||||
use Symfony\Component\Security\Core\User\UserInterface as SfUserInterface; | use Symfony\Component\Security\Core\User\UserInterface as SfUserInterface; | ||||
* @method UserInterface[] findAll() | * @method UserInterface[] findAll() | ||||
* @method UserInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | * @method UserInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | ||||
*/ | */ | ||||
class UserRepository extends BaseRepository implements PasswordUpgraderInterface | |||||
class UserRepository extends RepositoryAbstract implements PasswordUpgraderInterface | |||||
{ | { | ||||
public function getInterfaceClass() | public function getInterfaceClass() | ||||
{ | { |