|
- <?php
-
- namespace common\logic\Setting;
-
- use common\logic\AbstractRepository;
-
- class SettingRepository extends AbstractRepository
- {
- protected SettingRepositoryQuery $query;
-
- public function loadDependencies(): void
- {
- $this->loadQuery(SettingRepositoryQuery::class);
- }
-
- public function getDefaultOptionsSearch(): array
- {
- return [
- self::WITH => ['producer'],
- self::JOIN_WITH => [],
- self::ORDER_BY => '',
- self::ATTRIBUTE_ID_PRODUCER => 'setting.id_producer'
- ];
- }
-
- public function findOneSettingByName(string $name)
- {
- return $this->createDefaultQuery()
- ->filterByName($name)
- ->findOne();
- }
- }
|