<commit_before><?php

/*
 * Identity and Access Management server providing OAuth2, RBAC and logging
 *
 * @link      https://github.com/hiqdev/hiam-core
 * @package   hiam-core
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
 */

namespace hiam\storage;

class ClientQuery extends \yii\db\ActiveQuery
{
    public function init()
    {
        parent::init();
        $this
            ->select([
                'c.obj_id       AS id',
                'c.login        AS username',
                'r.login        AS seller',
                'y.name         AS type',
                'z.name         AS state',
                'k.first_name   AS first_name',
                'k.last_name    AS last_name',
                'coalesce(c.email,k.email) AS email',
            ])
            ->from('client          c')
            ->innerJoin('client     r', 'r.obj_id=c.seller_id')
            ->innerJoin('ref        y', 'y.obj_id=c.type_id')
            ->innerJoin('ref        z', "z.obj_id=c.state_id AND z.name IN ('ok')")
            ->leftJoin('contact     k', 'k.obj_id=c.obj_id')
        ;
    }

    public function andWhere($condition)
    {
        if (!is_array($condition) || $condition[0]) {
            return parent::andWhere($condition);
        }<commit_msg>+ seller_id to ClientQuery<commit_after><?php

/*
 * Identity and Access Management server providing OAuth2, RBAC and logging
 *
 * @link      https://github.com/hiqdev/hiam-core
 * @package   hiam-core
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
 */

namespace hiam\storage;

class ClientQuery extends \yii\db\ActiveQuery
{
    public function init()
    {
        parent::init();
        $this
            ->select([
                'c.obj_id       AS id',
                'c.login        AS username',
                'r.login        AS seller',
                'c.seller_id    AS seller_id',
                'y.name         AS type',
                'z.name         AS state',
                'k.first_name   AS first_name',
                'k.last_name    AS last_name',
                'coalesce(c.email,k.email) AS email',
            ])
            ->from('client          c')
            ->innerJoin('client     r', 'r.obj_id=c.seller_id')
            ->innerJoin('ref        y', 'y.obj_id=c.type_id')
            ->innerJoin('ref        z', "z.obj_id=c.state_id AND z.name IN ('ok')")
            ->leftJoin('contact     k', 'k.obj_id=c.obj_id')
        ;
    }

    public function andWhere($condition)
    {
        if (!is_array($condition) || $condition[0]) {
            return parent::andWhere($condition);
        }
{'fraction_non_alphanumeric': 0.1364644970414201, 'fraction_numerical': 0.008136094674556213, 'mean_word_length': 1.5304022450888681, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4199081', 'n_tokens_mistral': 859, 'n_tokens_neox': 826, 'n_words': 176}