Browse Source

Crud Page & News

ideas
Guillaume 3 years ago
parent
commit
2c1c7b66e7
10 changed files with 36 additions and 128 deletions
  1. +13
    -0
      Controller/Site/NewsAdminController.php
  2. +13
    -0
      Controller/Site/PageAdminController.php
  3. +4
    -4
      Model/Merchant/MerchantModel.php
  4. +2
    -2
      Model/Section/SectionModel.php
  5. +0
    -8
      Model/Site/NewsInterface.php
  6. +2
    -38
      Model/Site/NewsModel.php
  7. +0
    -8
      Model/Site/PageInterface.php
  8. +2
    -23
      Model/Site/PageModel.php
  9. +0
    -22
      Repository/Site/NewsRepository.php
  10. +0
    -23
      Repository/Site/PageRepository.php

+ 13
- 0
Controller/Site/NewsAdminController.php View File

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

}

+ 13
- 0
Controller/Site/PageAdminController.php View File

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

}

+ 4
- 4
Model/Merchant/MerchantModel.php View File

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;



+ 2
- 2
Model/Section/SectionModel.php View File

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;



+ 0
- 8
Model/Site/NewsInterface.php View File

<?php

namespace Lc\CaracoleBundle\Model\Site ;

interface NewsInterface
{

}

+ 2
- 38
Model/Site/NewsModel.php View File



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

+ 0
- 8
Model/Site/PageInterface.php View File

<?php

namespace Lc\CaracoleBundle\Model\Site;

interface PageInterface
{

}

+ 2
- 23
Model/Site/PageModel.php View File

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;

+ 0
- 22
Repository/Site/NewsRepository.php View File

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


}

+ 0
- 23
Repository/Site/PageRepository.php View File

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


}

Loading…
Cancel
Save