/
var
/
www
/
vhosts
/
nabawater
/
vendor
/
yiisoft
/
yii2
/
db
/
/var/www/vhosts/nabawater/vendor/yiisoft/yii2/db
mkdir
upload
Name
Size
Mode
Actions
conditions/
-
0755
rm
cubrid/
-
0755
rm
mssql/
-
0755
rm
mysql/
-
0755
rm
oci/
-
0755
rm
pgsql/
-
0755
rm
sqlite/
-
0755
rm
ActiveQuery.php
31506
0644
edit
dl
rm
ActiveQueryInterface.php
4542
0644
edit
dl
rm
ActiveQueryTrait.php
6315
0644
edit
dl
rm
ActiveRecord.php
29789
0644
edit
dl
rm
ActiveRecordInterface.php
21207
0644
edit
dl
rm
ActiveRelationTrait.php
23292
0644
edit
dl
rm
AfterSaveEvent.php
553
0644
edit
dl
rm
ArrayExpression.php
5400
0644
edit
dl
rm
BaseActiveRecord.php
69538
0644
edit
dl
rm
BatchQueryResult.php
4905
0644
edit
dl
rm
CheckConstraint.php
458
0644
edit
dl
rm
ColumnSchema.php
5356
0644
edit
dl
rm
ColumnSchemaBuilder.php
13287
0644
edit
dl
rm
Command.php
52026
0644
edit
dl
rm
Connection.php
45376
0644
edit
dl
rm
Constraint.php
566
0644
edit
dl
rm
ConstraintFinderInterface.php
6454
0644
edit
dl
rm
ConstraintFinderTrait.php
11204
0644
edit
dl
rm
DataReader.php
8518
0644
edit
dl
rm
DefaultValueConstraint.php
472
0644
edit
dl
rm
Exception.php
1457
0644
edit
dl
rm
Expression.php
1909
0644
edit
dl
rm
ExpressionBuilder.php
741
0644
edit
dl
rm
ExpressionBuilderInterface.php
860
0644
edit
dl
rm
ExpressionBuilderTrait.php
707
0644
edit
dl
rm
ExpressionInterface.php
615
0644
edit
dl
rm
ForeignKeyConstraint.php
937
0644
edit
dl
rm
IndexConstraint.php
553
0644
edit
dl
rm
IntegrityException.php
546
0644
edit
dl
rm
JsonExpression.php
2684
0644
edit
dl
rm
Migration.php
26933
0644
edit
dl
rm
MigrationInterface.php
1226
0644
edit
dl
rm
PdoValue.php
1370
0644
edit
dl
rm
PdoValueBuilder.php
692
0644
edit
dl
rm
Query.php
49520
0644
edit
dl
rm
QueryBuilder.php
74240
0644
edit
dl
rm
QueryExpressionBuilder.php
1044
0644
edit
dl
rm
QueryInterface.php
12820
0644
edit
dl
rm
QueryTrait.php
15155
0644
edit
dl
rm
Schema.php
31377
0644
edit
dl
rm
SchemaBuilderTrait.php
11495
0644
edit
dl
rm
SqlToken.php
9676
0644
edit
dl
rm
SqlTokenizer.php
14208
0644
edit
dl
rm
StaleObjectException.php
447
0644
edit
dl
rm
TableSchema.php
3129
0644
edit
dl
rm
Transaction.php
9365
0644
edit
dl
rm
ViewFinderTrait.php
1614
0644
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/vendor/yiisoft/yii2/db/ActiveQueryTrait.php
(6315B)
<?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */ namespace yii\db; /** * ActiveQueryTrait implements the common methods and properties for active record query classes. * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carsten Brandt <mail@cebe.cc> * @since 2.0 */ trait ActiveQueryTrait { /** * @var string the name of the ActiveRecord class. */ public $modelClass; /** * @var array a list of relations that this query should be performed with */ public $with; /** * @var bool whether to return each record as an array. If false (default), an object * of [[modelClass]] will be created to represent each record. */ public $asArray; /** * Sets the [[asArray]] property. * @param bool $value whether to return the query results in terms of arrays instead of Active Records. * @return $this the query object itself */ public function asArray($value = true) { $this->asArray = $value; return $this; } /** * Specifies the relations with which this query should be performed. * * The parameters to this method can be either one or multiple strings, or a single array * of relation names and the optional callbacks to customize the relations. * * A relation name can refer to a relation defined in [[modelClass]] * or a sub-relation that stands for a relation of a related record. * For example, `orders.address` means the `address` relation defined * in the model class corresponding to the `orders` relation. * * The following are some usage examples: * * ```php * // find customers together with their orders and country * Customer::find()->with('orders', 'country')->all(); * // find customers together with their orders and the orders' shipping address * Customer::find()->with('orders.address')->all(); * // find customers together with their country and orders of status 1 * Customer::find()->with([ * 'orders' => function (\yii\db\ActiveQuery $query) { * $query->andWhere('status = 1'); * }, * 'country', * ])->all(); * ``` * * You can call `with()` multiple times. Each call will add relations to the existing ones. * For example, the following two statements are equivalent: * * ```php * Customer::find()->with('orders', 'country')->all(); * Customer::find()->with('orders')->with('country')->all(); * ``` * * @return $this the query object itself */ public function with() { $with = func_get_args(); if (isset($with[0]) && is_array($with[0])) { // the parameter is given as an array $with = $with[0]; } if (empty($this->with)) { $this->with = $with; } elseif (!empty($with)) { foreach ($with as $name => $value) { if (is_int($name)) { // repeating relation is fine as normalizeRelations() handle it well $this->with[] = $value; } else { $this->with[$name] = $value; } } } return $this; } /** * Converts found rows into model instances. * @param array $rows * @return array|ActiveRecord[] * @since 2.0.11 */ protected function createModels($rows) { if ($this->asArray) { return $rows; } else { $models = []; /* @var $class ActiveRecord */ $class = $this->modelClass; foreach ($rows as $row) { $model = $class::instantiate($row); $modelClass = get_class($model); $modelClass::populateRecord($model, $row); $models[] = $model; } return $models; } } /** * Finds records corresponding to one or multiple relations and populates them into the primary models. * @param array $with a list of relations that this query should be performed with. Please * refer to [[with()]] for details about specifying this parameter. * @param array|ActiveRecord[] $models the primary models (can be either AR instances or arrays) */ public function findWith($with, &$models) { $primaryModel = reset($models); if (!$primaryModel instanceof ActiveRecordInterface) { /* @var $modelClass ActiveRecordInterface */ $modelClass = $this->modelClass; $primaryModel = $modelClass::instance(); } $relations = $this->normalizeRelations($primaryModel, $with); /* @var $relation ActiveQuery */ foreach ($relations as $name => $relation) { if ($relation->asArray === null) { // inherit asArray from primary query $relation->asArray($this->asArray); } $relation->populateRelation($name, $models); } } /** * @param ActiveRecord $model * @param array $with * @return ActiveQueryInterface[] */ private function normalizeRelations($model, $with) { $relations = []; foreach ($with as $name => $callback) { if (is_int($name)) { $name = $callback; $callback = null; } if (($pos = strpos($name, '.')) !== false) { // with sub-relations $childName = substr($name, $pos + 1); $name = substr($name, 0, $pos); } else { $childName = null; } if (!isset($relations[$name])) { $relation = $model->getRelation($name); $relation->primaryModel = null; $relations[$name] = $relation; } else { $relation = $relations[$name]; } if (isset($childName)) { $relation->with[$childName] = $callback; } elseif ($callback !== null) { call_user_func($callback, $relation); } } return $relations; } }
Save
cmd:
run