/
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/BatchQueryResult.php
(4905B)
<?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */ namespace yii\db; use yii\base\BaseObject; /** * BatchQueryResult represents a batch query from which you can retrieve data in batches. * * You usually do not instantiate BatchQueryResult directly. Instead, you obtain it by * calling [[Query::batch()]] or [[Query::each()]]. Because BatchQueryResult implements the [[\Iterator]] interface, * you can iterate it to obtain a batch of data in each iteration. For example, * * ```php * $query = (new Query)->from('user'); * foreach ($query->batch() as $i => $users) { * // $users represents the rows in the $i-th batch * } * foreach ($query->each() as $user) { * } * ``` * * @author Qiang Xue <qiang.xue@gmail.com> * @since 2.0 */ class BatchQueryResult extends BaseObject implements \Iterator { /** * @var Connection the DB connection to be used when performing batch query. * If null, the "db" application component will be used. */ public $db; /** * @var Query the query object associated with this batch query. * Do not modify this property directly unless after [[reset()]] is called explicitly. */ public $query; /** * @var int the number of rows to be returned in each batch. */ public $batchSize = 100; /** * @var bool whether to return a single row during each iteration. * If false, a whole batch of rows will be returned in each iteration. */ public $each = false; /** * @var DataReader the data reader associated with this batch query. */ private $_dataReader; /** * @var array the data retrieved in the current batch */ private $_batch; /** * @var mixed the value for the current iteration */ private $_value; /** * @var string|int the key for the current iteration */ private $_key; /** * Destructor. */ public function __destruct() { // make sure cursor is closed $this->reset(); } /** * Resets the batch query. * This method will clean up the existing batch query so that a new batch query can be performed. */ public function reset() { if ($this->_dataReader !== null) { $this->_dataReader->close(); } $this->_dataReader = null; $this->_batch = null; $this->_value = null; $this->_key = null; } /** * Resets the iterator to the initial state. * This method is required by the interface [[\Iterator]]. */ public function rewind() { $this->reset(); $this->next(); } /** * Moves the internal pointer to the next dataset. * This method is required by the interface [[\Iterator]]. */ public function next() { if ($this->_batch === null || !$this->each || $this->each && next($this->_batch) === false) { $this->_batch = $this->fetchData(); reset($this->_batch); } if ($this->each) { $this->_value = current($this->_batch); if ($this->query->indexBy !== null) { $this->_key = key($this->_batch); } elseif (key($this->_batch) !== null) { $this->_key = $this->_key === null ? 0 : $this->_key + 1; } else { $this->_key = null; } } else { $this->_value = $this->_batch; $this->_key = $this->_key === null ? 0 : $this->_key + 1; } } /** * Fetches the next batch of data. * @return array the data fetched */ protected function fetchData() { if ($this->_dataReader === null) { $this->_dataReader = $this->query->createCommand($this->db)->query(); } $rows = []; $count = 0; while ($count++ < $this->batchSize && ($row = $this->_dataReader->read())) { $rows[] = $row; } return $this->query->populate($rows); } /** * Returns the index of the current dataset. * This method is required by the interface [[\Iterator]]. * @return int the index of the current row. */ public function key() { return $this->_key; } /** * Returns the current dataset. * This method is required by the interface [[\Iterator]]. * @return mixed the current dataset. */ public function current() { return $this->_value; } /** * Returns whether there is a valid dataset at the current position. * This method is required by the interface [[\Iterator]]. * @return bool whether there is a valid dataset at the current position. */ public function valid() { return !empty($this->_batch); } }
Save
cmd:
run