X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=blobdiff_plain;f=includes%2Fdb%2FORMTable.php;h=a77074ffca7626e52e3684a852e4916d41b07764;hb=29719f846b8887e1190ddf85125387c079f9539b;hp=a4396af4e4a5b6dcbee5041264d56446ae47076f;hpb=176119237607de5ed6659296b08209270b26b84a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/ORMTable.php b/includes/db/ORMTable.php index a4396af4e4..a77074ffca 100644 --- a/includes/db/ORMTable.php +++ b/includes/db/ORMTable.php @@ -308,7 +308,7 @@ abstract class ORMTable implements IORMTable { */ public function count( array $conditions = array(), array $options = array() ) { $res = $this->rawSelectRow( - array( 'COUNT(*) AS rowcount' ), + array( 'rowcount' => 'COUNT(*)' ), $this->getPrefixedValues( $conditions ), $options ); @@ -329,7 +329,7 @@ abstract class ORMTable implements IORMTable { 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... } @@ -452,7 +452,10 @@ abstract class ORMTable implements IORMTable { 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();