php-kitchen/yii2-domain

View on GitHub
docs/examples/user/UserQuery.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace PHPKitchen\Examples\User;

use PHPKitchen\Domain\DB\RecordQuery;

/**
 * Represents user DB record query.
 *
 * @package PHPKitchen\Examples\User
 * @author Dmitry Kolodko <prowwid@gmail.com>
 */
class UserQuery extends RecordQuery {
    public function active() {
        return $this->andWhere('status=:status', ['status' => UserEntity::STATUS_ACTIVE]);
    }

    public function inactive() {
        return $this->andWhere('status=:status', ['status' => UserEntity::STATUS_INACTIVE]);
    }
}