You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace common\repositories;
-
- use common\models\Producer;
-
- class ProducerRepository
- {
- public function getOneById($id)
- {
- return Producer::searchOne(['id' => $id]);
- }
-
- public function getOneBySlug($slug)
- {
- return Producer::searchOne(['slug' => $slug]);
- }
-
- public function queryActive()
- {
- return Producer::find()
- ->where([
- 'active' => true,
- ])
- ->orderBy('name ASC');
- }
-
- /**
- * Retourne le compte producteur de démonstration.
- *
- * @return Producer
- */
- public function getDemoAccount()
- {
- return Producer::find()->where('name LIKE \'Démo\'')->one();
- }
- }
|