From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../Data/Common/Pgsql/TPgsqlCommandBuilder.php | 136 ++++++++++----------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php') diff --git a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php index 8f4147e5..f9938d61 100644 --- a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php +++ b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php @@ -1,69 +1,69 @@ - - * @link http://www.pradosoft.com/ + + * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2012 PradoSoft - * @license http://www.pradosoft.com/license/ - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ - * @package System.Data.Common - */ - -Prado::using('System.Data.Common.TDbCommandBuilder'); - -/** - * TPgsqlCommandBuilder provides specifics methods to create limit/offset query commands - * for Pgsql database. - * - * @author Wei Zhuo - * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ - * @package System.Data.Common - * @since 3.1 - */ -class TPgsqlCommandBuilder extends TDbCommandBuilder -{ - /** - * Overrides parent implementation. Only column of type text or character (and its variants) - * accepts the LIKE criteria. - * @param array list of column id for potential search condition. - * @param string string of keywords - * @return string SQL search condition matching on a set of columns. - */ - public function getSearchExpression($fields, $keywords) - { - $columns = array(); - foreach($fields as $field) - { - if($this->isSearchableColumn($this->getTableInfo()->getColumn($field))) - $columns[] = $field; - } - return parent::getSearchExpression($columns, $keywords); - } - /** - * - * @return boolean true if column can be used for LIKE searching. - */ - protected function isSearchableColumn($column) - { - $type = strtolower($column->getDbType()); - return $type === 'character varying' || $type === 'varchar' || - $type === 'character' || $type === 'char' || $type === 'text'; - } - - /** - * Overrides parent implementation to use PostgreSQL's ILIKE instead of LIKE (case-sensitive). - * @param string column name. - * @param array keywords - * @return string search condition for all words in one column. - */ - protected function getSearchCondition($column, $words) - { - $conditions=array(); - foreach($words as $word) - $conditions[] = $column.' ILIKE '.$this->getDbConnection()->quoteString('%'.$word.'%'); - return '('.implode(' AND ', $conditions).')'; - } - -} - + * @license http://www.pradosoft.com/license/ + * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ + * @package System.Data.Common + */ + +Prado::using('System.Data.Common.TDbCommandBuilder'); + +/** + * TPgsqlCommandBuilder provides specifics methods to create limit/offset query commands + * for Pgsql database. + * + * @author Wei Zhuo + * @version $Id: TDbCommandBuilder.php 1863 2007-04-12 12:43:49Z wei $ + * @package System.Data.Common + * @since 3.1 + */ +class TPgsqlCommandBuilder extends TDbCommandBuilder +{ + /** + * Overrides parent implementation. Only column of type text or character (and its variants) + * accepts the LIKE criteria. + * @param array list of column id for potential search condition. + * @param string string of keywords + * @return string SQL search condition matching on a set of columns. + */ + public function getSearchExpression($fields, $keywords) + { + $columns = array(); + foreach($fields as $field) + { + if($this->isSearchableColumn($this->getTableInfo()->getColumn($field))) + $columns[] = $field; + } + return parent::getSearchExpression($columns, $keywords); + } + /** + * + * @return boolean true if column can be used for LIKE searching. + */ + protected function isSearchableColumn($column) + { + $type = strtolower($column->getDbType()); + return $type === 'character varying' || $type === 'varchar' || + $type === 'character' || $type === 'char' || $type === 'text'; + } + + /** + * Overrides parent implementation to use PostgreSQL's ILIKE instead of LIKE (case-sensitive). + * @param string column name. + * @param array keywords + * @return string search condition for all words in one column. + */ + protected function getSearchCondition($column, $words) + { + $conditions=array(); + foreach($words as $word) + $conditions[] = $column.' ILIKE '.$this->getDbConnection()->quoteString('%'.$word.'%'); + return '('.implode(' AND ', $conditions).')'; + } + +} + -- cgit v1.2.3