diff options
author | Reedy <reedy@wikimedia.org> | 2015-10-06 16:58:18 +0100 |
---|---|---|
committer | Reedy <reedy@wikimedia.org> | 2015-10-29 13:06:36 +0000 |
commit | d9d22e8f0b4aaa4748343680c68687c586eddcc5 (patch) | |
tree | 7518704f7d1b77f8f54a97c1983293945ab02fe3 /includes/db/ORMResult.php | |
parent | 19122929fcc4dd4550e67c9a337c83a256a1fe48 (diff) | |
download | mediawikicore-d9d22e8f0b4aaa4748343680c68687c586eddcc5.tar.gz mediawikicore-d9d22e8f0b4aaa4748343680c68687c586eddcc5.zip |
Remove ORM code from core
Bug: T114538
Change-Id: Ic4196ca9da927fc5c85b01cfff65f0636e3202ae
Diffstat (limited to 'includes/db/ORMResult.php')
-rw-r--r-- | includes/db/ORMResult.php | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/includes/db/ORMResult.php b/includes/db/ORMResult.php deleted file mode 100644 index 327d20d9e43c..000000000000 --- a/includes/db/ORMResult.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -/** - * ORMIterator that takes a ResultWrapper object returned from - * a select operation returning IORMRow objects (ie IORMTable::select). - * - * Documentation inline and at https://www.mediawiki.org/wiki/Manual:ORMTable - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @since 1.20 - * - * @file ORMResult.php - * @ingroup ORM - * - * @license GNU GPL v2 or later - * @author Jeroen De Dauw < jeroendedauw@gmail.com > - */ - -class ORMResult implements ORMIterator { - /** - * @var ResultWrapper - */ - protected $res; - - /** - * @var int - */ - protected $key; - - /** - * @var IORMRow - */ - protected $current; - - /** - * @var IORMTable - */ - protected $table; - - /** - * @param IORMTable $table - * @param ResultWrapper $res - */ - public function __construct( IORMTable $table, ResultWrapper $res ) { - $this->table = $table; - $this->res = $res; - $this->key = 0; - $this->setCurrent( $this->res->current() ); - } - - /** - * @param bool|object $row - */ - protected function setCurrent( $row ) { - if ( $row === false ) { - $this->current = false; - } else { - $this->current = $this->table->newRowFromDBResult( $row ); - } - } - - /** - * @return int - */ - public function count() { - return $this->res->numRows(); - } - - /** - * @return bool - */ - public function isEmpty() { - return $this->res->numRows() === 0; - } - - /** - * @return IORMRow - */ - public function current() { - return $this->current; - } - - /** - * @return int - */ - public function key() { - return $this->key; - } - - public function next() { - $row = $this->res->next(); - $this->setCurrent( $row ); - $this->key++; - } - - public function rewind() { - $this->res->rewind(); - $this->key = 0; - $this->setCurrent( $this->res->current() ); - } - - /** - * @return bool - */ - public function valid() { - return $this->current !== false; - } -} |