<?php
/**
* Abstract base class for representing a single database table.
+ * 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
*/
public function count( array $conditions = array(), array $options = array() ) {
$res = $this->rawSelectRow(
- array( 'COUNT(*) AS rowcount' ),
+ array( 'rowcount' => 'COUNT(*)' ),
$this->getPrefixedValues( $conditions ),
$options
);
public function delete( array $conditions, $functionName = null ) {
return wfGetDB( DB_MASTER )->delete(
$this->getName(),
- $this->getPrefixedValues( $conditions ),
+ $conditions === array() ? '*' : $this->getPrefixedValues( $conditions ),
$functionName
) !== false; // DatabaseBase::delete does not always return true for success as documented...
}
public function updateSummaryFields( $summaryFields = null, array $conditions = array() ) {
$this->setReadDb( DB_MASTER );
- foreach ( $this->select( null, $conditions ) as /* IORMRow */ $item ) {
+ /**
+ * @var IORMRow $item
+ */
+ foreach ( $this->select( null, $conditions ) as $item ) {
$item->loadSummaryFields( $summaryFields );
$item->setSummaryMode( true );
$item->save();
/**
* @see ORMTable::newRowFromFromDBResult
*
- * @deprecated use newRowFromFromDBResult instead
+ * @deprecated use newRowFromDBResult instead
* @since 1.20
*
* @param stdClass $result