cvs: pear /MDB_QueryTool/QueryTool Query.php

From: Date: Sun, 27 Feb 2005 19:13:04 +0000
Subject: cvs: pear /MDB_QueryTool/QueryTool Query.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-29872@lists.php.net to get a copy of this message
quipo Sun Feb 27 14:13:04 2005 EDT Modified files: /pear/MDB_QueryTool/QueryTool Query.php Log: doc typos and tweaks http://cvs.php.net/diff.php/pear/MDB_QueryTool/QueryTool/Query.php?r1=1.44&r2=1.45&ty=u Index: pear/MDB_QueryTool/QueryTool/Query.php diff -u pear/MDB_QueryTool/QueryTool/Query.php:1.44 pear/MDB_QueryTool/QueryTool/Query.php:1.45 --- pear/MDB_QueryTool/QueryTool/Query.php:1.44 Fri Feb 25 10:43:30 2005 +++ pear/MDB_QueryTool/QueryTool/Query.php Sun Feb 27 14:13:03 2005 @@ -17,7 +17,7 @@ * @author Lorenzo Alberton <l dot alberton at quipo dot it> * @copyright 2004-2005 Lorenzo Alberton * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Query.php,v 1.44 2005/02/25 15:43:30 quipo Exp $ + * @version CVS: $Id: Query.php,v 1.45 2005/02/27 19:13:03 quipo Exp $ * @link http://pear.php.net/package/MDB_QueryTool */ @@ -333,10 +333,10 @@ * if the second parameter is only one column the result will be returned * directly not as an array! * - * @param integer the id of the element to retreive + * @param integer the id of the element to retrieve * @param string if this is given only one row shall be returned, * directly, not an array - * @return mixed (1) an array of the retreived data + * @return mixed (1) an array of the retrieved data * (2) if the second parameter is given and its only one column, * only this column's data will be returned * (3) false in case of failure @@ -421,7 +421,7 @@ * $ids = $table->getCol(); * OR * $ids = $table->getCol('id'); - * so ids will ba an array with all the id's + * so ids will be an array with all the id's * * @param string the column that shall be retreived * @param int to start from @@ -690,7 +690,7 @@ * removes a member from the DB * * @param mixed integer/string - the value of the column that shall be removed - * array - multiple columns that shall be matched, the second parameter will be ommited + * array - multiple columns that shall be matched, the second parameter will be ignored * @param string the column to match the data against, only if $data is not an array * @return boolean * @access public @@ -749,16 +749,17 @@ */ function removeMultiple($ids, $colName='') { - if ($colName=='') { + if ($colName == '') { $colName = $this->primaryCol; } $ids = $this->_quoteArray($ids); - $query = sprintf( 'DELETE FROM %s WHERE %s IN (%s)', //IS THIS PORTABLE??????????????????? - $this->table, - $colName, - implode(',', $ids) - ); + $query = sprintf( + 'DELETE FROM %s WHERE %s IN (%s)', + $this->table, + $colName, + implode(',', $ids) + ); return $this->execute($query, 'query') ? true : false; } @@ -781,7 +782,7 @@ $argCounter = 2; // we have 2 parameters that need to be given at least // func_get_arg returns false and a warning if there are no more parameters, so // we suppress the warning and check for false - while($object=@func_get_arg($argCounter++)) { + while ($object = @func_get_arg($argCounter++)) { //FIXXXME let $object also simply be a table name if (!$object->remove($id, $colName)) { //FIXXXME do this better @@ -833,7 +834,7 @@ // {{{ setWhere() /** - * sets the where condition which is used for the current instance + * Sets the where condition which is used for the current instance * * @param string the where condition, this can be complete like 'X=7 AND Y=8' * @access public @@ -849,10 +850,10 @@ // {{{ getWhere() /** - * gets the where condition which is used for the current instance + * Gets the where condition which is used for the current instance * - * @return string the where condition, this can be complete like 'X=7 AND Y=8' - * @access public + * @return string the where condition, this can be complete like 'X=7 AND Y=8' + * @access public */ function getWhere() { @@ -863,14 +864,14 @@ // {{{ addWhere() /** - * only adds a string to the where clause + * Only adds a string to the where clause * - * @param string the where clause to add to the existing one - * @param string the condition for how to concatenate the new where clause - * to the existing one - * @access public + * @param string the where clause to add to the existing one + * @param string the condition for how to concatenate the new where clause + * to the existing one + * @access public */ - function addWhere($where , $condition='AND') + function addWhere($where, $condition='AND') { if ($this->getWhere()) { $where = $this->getWhere().' '.$condition.' '.$where; @@ -886,7 +887,7 @@ * i.e. calling it like this: * $this->addWhereSearch('name', 'otto hans') * produces a where clause like this one - * LOWER(name) LIKE "%otto%hans%" + * UPPER(name) LIKE "%OTTO%HANS%" * so the search finds the given string * * @param string the column to search in for @@ -896,8 +897,8 @@ */ function addWhereSearch($column, $string, $condition='AND') { - // if the column doesnt contain a tablename use the current table name in case it is a defined column - // to prevent ambigious rows + // if the column doesn't contain a tablename use the current table name + // in case it is a defined column to prevent ambiguous rows if (strpos($column, '.') === false) { $meta = $this->metadata(); if (isset($meta[$column])) { @@ -992,7 +993,7 @@ /** * Extend the current having clause. This is very useful, when you are building - * this clause from different places and dont want to overwrite the currently + * this clause from different places and don't want to overwrite the currently * set having clause, but extend it. * * @param string this is a having clause, i.e. 'column' or 'table.column' or 'MAX(column)' @@ -1297,7 +1298,7 @@ // {{{ reset() /** - * reset all the set* settings, with no parameter given it resets all + * reset all the set* settings, with no parameter given it resets them all. * * @return void * @access public @@ -1600,7 +1601,7 @@ // {{{ getTableShortName() /** - * this method gets the short name for a table + * Gets the short name for a table * * get the short name for a table, this is needed to properly build the * 'AS' parts in the select query

« previous php.pear.cvs (#29872) next »