uawdijnntqw1x1x1
IP : 216.73.216.107
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
vendor
/
yiisoft
/
.
/
yii2-debug
/
src
/
models
/
search
/
User.php
/
/
<?php /** * @link https://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license https://www.yiiframework.com/license/ */ namespace yii\debug\models\search; use yii\base\Model; use yii\data\ActiveDataProvider; use yii\db\ActiveRecord; /** * Search model for implementation of IdentityInterface * * @author Semen Dubina <yii2debug@sam002.net> * @since 2.0.10 */ class User extends Model { /** * @var Model implementation of IdentityInterface */ public $identityImplement = null; /** * {@inheritdoc} */ public function init() { if (\Yii::$app->user && \Yii::$app->user->identityClass) { $identityImplementation = new \Yii::$app->user->identityClass(); if ($identityImplementation instanceof Model) { $this->identityImplement = $identityImplementation; } } parent::init(); } /** * {@inheritdoc} */ public function __get($name) { return $this->identityImplement->__get($name); } /** * {@inheritdoc} */ public function __set($name, $value) { return $this->identityImplement->__set($name, $value); } /** * {@inheritdoc} */ public function rules() { return [[array_keys($this->identityImplement->getAttributes()), 'safe']]; } /** * {@inheritdoc} */ public function attributes() { return $this->identityImplement->attributes(); } /** * {@inheritdoc} * @throws \yii\base\InvalidConfigException */ public function search($params) { if ($this->identityImplement instanceof ActiveRecord) { return $this->searchActiveDataProvider($params); } return null; } /** * Search method for ActiveRecord * @param array $params the data array to load model. * @return ActiveDataProvider * @throws \yii\base\InvalidConfigException */ private function searchActiveDataProvider($params) { /** @var ActiveRecord $model */ $model = $this->identityImplement; $query = $model::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } foreach ($model::getTableSchema()->columns as $attribute => $column) { if ($column->phpType === 'string') { $query->andFilterWhere(['like', $attribute, $model->getAttribute($attribute)]); } else { $query->andFilterWhere([$attribute => $model->getAttribute($attribute)]); } } return $dataProvider; } }
/srv/users/craft4/apps/craft4-newsite-space/vendor/yiisoft/./yii2-debug/src/models/search/User.php