<?php | |||||
namespace Lc\CaracoleBundle\Controller\Site; | |||||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||||
use Lc\SovBundle\Controller\Site\NewsAdminController as SovNewsAdminController; | |||||
abstract class NewsAdminController extends SovNewsAdminController | |||||
{ | |||||
use AdminControllerTrait; | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Controller\Site; | |||||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||||
use Lc\SovBundle\Controller\Site\PageAdminController as SovPageAdminController; | |||||
abstract class PageAdminController extends SovPageAdminController | |||||
{ | |||||
use AdminControllerTrait; | |||||
} |
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Model\Setting\EntitySettingTrait; | use Lc\CaracoleBundle\Model\Setting\EntitySettingTrait; | ||||
use Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface; | use Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface; | ||||
use Lc\CaracoleBundle\Model\Site\NewsInterface; | |||||
use Lc\CaracoleBundle\Model\Site\PageInterface; | |||||
use Lc\SovBundle\Model\Site\NewsInterface; | |||||
use Lc\SovBundle\Model\Site\PageInterface; | |||||
use Lc\SovBundle\Model\User\GroupUserInterface; | use Lc\SovBundle\Model\User\GroupUserInterface; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | ||||
protected $productCategories; | protected $productCategories; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Site\NewsInterface", mappedBy="merchant", orphanRemoval=true) | |||||
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Site\NewsInterface", mappedBy="merchant", orphanRemoval=true) | |||||
*/ | */ | ||||
protected $news; | protected $news; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Site\PageInterface", mappedBy="merchant", orphanRemoval=true) | |||||
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Site\PageInterface", mappedBy="merchant", orphanRemoval=true) | |||||
*/ | */ | ||||
protected $pages; | protected $pages; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Model\Setting\EntitySettingTrait; | use Lc\CaracoleBundle\Model\Setting\EntitySettingTrait; | ||||
use Lc\CaracoleBundle\Model\Setting\SectionSettingInterface; | use Lc\CaracoleBundle\Model\Setting\SectionSettingInterface; | ||||
use Lc\CaracoleBundle\Model\Site\PageInterface; | |||||
use Lc\SovBundle\Model\Site\PageInterface; | |||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | ||||
/** | /** | ||||
protected $productCategories; | protected $productCategories; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Site\PageInterface", mappedBy="section") | |||||
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Site\PageInterface", mappedBy="section") | |||||
*/ | */ | ||||
protected $pages; | protected $pages; | ||||
<?php | |||||
namespace Lc\CaracoleBundle\Model\Site ; | |||||
interface NewsInterface | |||||
{ | |||||
} |
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | ||||
use Gedmo\Mapping\Annotation as Gedmo; | |||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||||
use Lc\SovBundle\Model\Site\NewsModel as SovNewsModel; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class NewsModel extends AbstractFullEntity implements FilterMerchantInterface | |||||
abstract class NewsModel extends SovNewsModel implements FilterMerchantInterface | |||||
{ | { | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="news") | * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="news") | ||||
*/ | */ | ||||
protected $merchant; | protected $merchant; | ||||
/** | |||||
* @ORM\Column(type="datetime") | |||||
* @Gedmo\Timestampable(on="create") | |||||
*/ | |||||
protected $date; | |||||
/** | |||||
* @ORM\Column(type="boolean", nullable=true) | |||||
*/ | |||||
protected $isSent; | |||||
public function getDate(): ?\DateTimeInterface | |||||
{ | |||||
return $this->date; | |||||
} | |||||
public function setDate(\DateTimeInterface $date): self | |||||
{ | |||||
$this->date = $date; | |||||
return $this; | |||||
} | |||||
public function getMerchant(): ?MerchantInterface | public function getMerchant(): ?MerchantInterface | ||||
{ | { | ||||
return $this->merchant; | return $this->merchant; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIsSent(): ?bool | |||||
{ | |||||
return $this->isSent; | |||||
} | |||||
public function setIsSent(?bool $isSent): self | |||||
{ | |||||
$this->isSent = $isSent; | |||||
return $this; | |||||
} | |||||
} | } |
<?php | |||||
namespace Lc\CaracoleBundle\Model\Site; | |||||
interface PageInterface | |||||
{ | |||||
} |
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | use Lc\CaracoleBundle\Model\Section\SectionInterface; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||||
use Lc\SovBundle\Model\Site\PageModel as SovPageModel; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class PageModel extends AbstractFullEntity implements FilterMerchantInterface, FilterSectionInterface | |||||
abstract class PageModel extends SovPageModel implements FilterMerchantInterface, FilterSectionInterface | |||||
{ | { | ||||
/** | |||||
* @ORM\Column(type="text", nullable=true) | |||||
*/ | |||||
protected $content; | |||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="pages") | * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="pages") | ||||
protected $section; | protected $section; | ||||
public function __toString() | |||||
{ | |||||
return $this->getTitle(); | |||||
} | |||||
public function getContent(): ?string | |||||
{ | |||||
return $this->content; | |||||
} | |||||
public function setContent(?string $content): self | |||||
{ | |||||
$this->content = $content; | |||||
return $this; | |||||
} | |||||
public function getMerchant(): ?MerchantInterface | public function getMerchant(): ?MerchantInterface | ||||
{ | { | ||||
return $this->merchant; | return $this->merchant; |
<?php | |||||
namespace Lc\CaracoleBundle\Repository\Site; | |||||
use Lc\CaracoleBundle\Model\Site\NewsInterface; | |||||
use Lc\SovBundle\Repository\AbstractRepository; | |||||
/** | |||||
* @method NewsInterface|null find($id, $lockMode = null, $lockVersion = null) | |||||
* @method NewsInterface|null findOneBy(array $criteria, array $orderBy = null) | |||||
* @method NewsInterface[] findAll() | |||||
* @method NewsInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||||
*/ | |||||
class NewsRepository extends AbstractRepository | |||||
{ | |||||
public function getInterfaceClass() | |||||
{ | |||||
return NewsInterface::class; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Repository\Site; | |||||
use Lc\CaracoleBundle\Model\Site\NewsInterface; | |||||
use Lc\CaracoleBundle\Model\Site\PageInterface; | |||||
use Lc\SovBundle\Repository\AbstractRepository; | |||||
/** | |||||
* @method PageInterface|null find($id, $lockMode = null, $lockVersion = null) | |||||
* @method PageInterface|null findOneBy(array $criteria, array $orderBy = null) | |||||
* @method PageInterface[] findAll() | |||||
* @method PageInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||||
*/ | |||||
class PageRepository extends AbstractRepository | |||||
{ | |||||
public function getInterfaceClass() | |||||
{ | |||||
return PageInterface::class; | |||||
} | |||||
} |