trait BlameableNullableTrait | trait BlameableNullableTrait | ||||
{ | { | ||||
/** | |||||
* @Gedmo\Blameable(on="create") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | |||||
*/ | |||||
protected $createdBy; | |||||
/** | |||||
* @Gedmo\Blameable(on="create") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | |||||
*/ | |||||
protected $createdBy; | |||||
/** | |||||
* @Gedmo\Blameable(on="update") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | |||||
*/ | |||||
protected $updatedBy; | |||||
/** | |||||
* @Gedmo\Blameable(on="update") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | |||||
*/ | |||||
protected $updatedBy; | |||||
public function getCreatedBy(): ?UserInterface | |||||
{ | |||||
return $this->createdBy; | |||||
} | |||||
public function setCreatedBy(?UserInterface $createdBy): self | |||||
{ | |||||
$this->createdBy = $createdBy; | |||||
return $this; | |||||
} | |||||
public function getUpdatedBy(): ?UserInterface | |||||
{ | |||||
return $this->updatedBy; | |||||
} | |||||
public function setUpdatedBy(?UserInterface $updatedBy): self | |||||
{ | |||||
$this->updatedBy = $updatedBy; | |||||
return $this; | |||||
} | |||||
} | } |
return $this->query->getQuery()->getResult(); | return $this->query->getQuery()->getResult(); | ||||
} | } | ||||
public function limit(int $maxResults) | |||||
public function limit(int $maxResults):self | |||||
{ | { | ||||
return $this->query->setMaxResults($maxResults); | |||||
$this->query->setMaxResults($maxResults); | |||||
return $this; | |||||
} | } | ||||
public function paginate(int $page = 1, int $limit = 20) | public function paginate(int $page = 1, int $limit = 20) | ||||
} | } | ||||
} | } | ||||
public function filterById(int $id) | |||||
public function filterById(int $id):self | |||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.id = :id') | ->andWhere('.id = :id') | ||||
/* | /* | ||||
* SLUG | * SLUG | ||||
*/ | */ | ||||
public function filterBySlug(string $slug) | |||||
public function filterBySlug(string $slug):self | |||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.slug = :slug') | ->andWhere('.slug = :slug') | ||||
/* | /* | ||||
* TREE | * TREE | ||||
*/ | */ | ||||
public function filterIsParent() | |||||
public function filterIsParent():self | |||||
{ | { | ||||
return $this->andWhere('.parent is NULL'); | return $this->andWhere('.parent is NULL'); | ||||
} | } | ||||
public function filterIsChildren() | |||||
public function filterIsChildren():self | |||||
{ | { | ||||
return $this->andWhere('.parent is NOT NULL'); | return $this->andWhere('.parent is NOT NULL'); | ||||
} | } | ||||
public function filterByParent(EntityInterface $parent) | |||||
public function filterByParent(EntityInterface $parent):self | |||||
{ | { | ||||
return $this->andWhere('.parent = :parent')->setParameter('parent', $parent); | return $this->andWhere('.parent = :parent')->setParameter('parent', $parent); | ||||
} | } | ||||
/* | /* | ||||
* STATUS | * STATUS | ||||
*/ | */ | ||||
public function filterByStatus(int $status):self | |||||
{ | |||||
return $this->andWhereStatus($this->id, $status); | |||||
} | |||||
public function filterIsOffline():self | public function filterIsOffline():self | ||||
{ | { | ||||
return $this->andWhereStatus($this->id, 0); | return $this->andWhereStatus($this->id, 0); |
namespace Lc\SovBundle\Repository\File; | namespace Lc\SovBundle\Repository\File; | ||||
use Lc\SovBundle\Repository\AbstractStore; | use Lc\SovBundle\Repository\AbstractStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
class FileStore extends AbstractStore implements FileStoreInterface | class FileStore extends AbstractStore implements FileStoreInterface | ||||
{ | { | ||||
{ | { | ||||
$this->query = $query; | $this->query = $query; | ||||
} | } | ||||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
} | } |
namespace Lc\SovBundle\Repository\Newsletter; | namespace Lc\SovBundle\Repository\Newsletter; | ||||
use Lc\SovBundle\Repository\AbstractStore; | use Lc\SovBundle\Repository\AbstractStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
class NewsletterStore extends AbstractStore implements NewsletterStoreInterface | class NewsletterStore extends AbstractStore implements NewsletterStoreInterface | ||||
{ | { | ||||
{ | { | ||||
$this->query = $query; | $this->query = $query; | ||||
} | } | ||||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
} | } |
{ | { | ||||
public function create(); | public function create(); | ||||
public function call(callable $fn): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function call(callable $fn):self; | |||||
public function count(): string; | public function count(): string; | ||||
public function find(): array; | public function find(): array; | ||||
public function limit(int $maxResults); | |||||
public function limit(int $maxResults):self; | |||||
public function paginate(int $page = 1, int $limit = 20); | public function paginate(int $page = 1, int $limit = 20); | ||||
public function getRepository(): ServiceEntityRepository; | public function getRepository(): ServiceEntityRepository; | ||||
public function groupBy(string $field): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function groupBy(string $field):self; | |||||
public function orderBy(string $field, string $sort = 'ASC'): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function orderBy(string $field, string $sort = 'ASC'):self; | |||||
public function filterById(int $id); | |||||
public function filterById(int $id):self; | |||||
public function filterByDevAlias(string $devAlias): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function filterByDevAlias(string $devAlias):self; | |||||
public function filterBySlug(string $slug); | |||||
public function filterBySlug(string $slug):self; | |||||
public function filterIsParent(); | |||||
public function filterIsParent():self; | |||||
public function filterIsChildren(); | |||||
public function filterIsChildren():self; | |||||
public function filterByParent(EntityInterface $parent); | |||||
public function filterByParent(EntityInterface $parent):self; | |||||
public function filterByStatus($status): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function filterIsOffline():self; | |||||
public function filterIsOffline(): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function filterIsOnline():self; | |||||
public function filterIsOnline(): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function filterIsDeleted():self; | |||||
public function filterIsDeleted(): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function filterIsOnlineAndOffline(): \Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||||
public function filterIsOnlineAndOffline():self; | |||||
} | } |
namespace Lc\SovBundle\Repository\Setting; | namespace Lc\SovBundle\Repository\Setting; | ||||
use Lc\SovBundle\Repository\AbstractStore; | use Lc\SovBundle\Repository\AbstractStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
class SiteSettingStore extends AbstractStore implements SiteSettingStoreInterface | class SiteSettingStore extends AbstractStore implements SiteSettingStoreInterface | ||||
{ | { | ||||
{ | { | ||||
$this->query = $query; | $this->query = $query; | ||||
} | } | ||||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
} | } |
namespace Lc\SovBundle\Repository\Site; | namespace Lc\SovBundle\Repository\Site; | ||||
use Lc\SovBundle\Repository\AbstractStore; | use Lc\SovBundle\Repository\AbstractStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
class SiteStore extends AbstractStore implements SiteStoreInterface | class SiteStore extends AbstractStore implements SiteStoreInterface | ||||
{ | { | ||||
{ | { | ||||
$this->query = $query; | $this->query = $query; | ||||
} | } | ||||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
} | } |
namespace Lc\SovBundle\Repository\Ticket; | namespace Lc\SovBundle\Repository\Ticket; | ||||
use Lc\SovBundle\Repository\AbstractStore; | use Lc\SovBundle\Repository\AbstractStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
class TicketMessageStore extends AbstractStore implements TicketMessageStoreInterface | class TicketMessageStore extends AbstractStore implements TicketMessageStoreInterface | ||||
{ | { | ||||
{ | { | ||||
$this->query = $query; | $this->query = $query; | ||||
} | } | ||||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
} | } |
{ | { | ||||
public function getValue(SettingInterface $setting) | public function getValue(SettingInterface $setting) | ||||
{ | { | ||||
if ($this->getText()) { | |||||
return $this->getText(); | |||||
} elseif ($this->getDate()) { | |||||
return $this->getDate(); | |||||
} elseif ($this->getFile()) { | |||||
return $this->getFile(); | |||||
if ($setting->getText()) { | |||||
return $setting->getText(); | |||||
} elseif ($setting->getDate()) { | |||||
return $setting->getDate(); | |||||
} elseif ($setting->getFile()) { | |||||
return $setting->getFile(); | |||||
} | } | ||||
} | } | ||||
} | } |