Class CMS_forms_search

Description

Class CMS_resource_cms_news_search

This class performs searches and returns resultsets, number of records founded, paginate, etc.

Located in /automne/classes/modules/cms_forms/formssearch.php (line 28)

CMS_grandFather
   |
   --CMS_forms_search
Method Summary
 CMS_forms_search __construct ([string $where = false], [string $orderBy = false], [integer $page = false], [integer $itemsPerPage = false], boolean $public)
 void addWhereCondition ( $type, string $value, string $key)
 string getAttribute (string $name)
 integer getMaxPages ()
 integer getNumRows ()
 array(CMS_resources_cms_news) search ()
 void setAttribute (string $name, $value $value)
 string _buildSQL ()
 string _getResultsCount ()
 string _sanitizeSQLString ( $s, string $s,)
Methods
Constructor __construct (line 113)

Constructor

  • access: public
CMS_forms_search __construct ([string $where = false], [string $orderBy = false], [integer $page = false], [integer $itemsPerPage = false], boolean $public)
  • string $where
  • string $orderBy
  • integer $page
  • integer $itemsPerPage
  • boolean $public
addWhereCondition (line 165)

Builds where statement with a key and its value

The key can be known, this class will create statements in consequence or not known so key is understood as a field name and this method will append a statement such $key='$value'

  • access: public
void addWhereCondition ( $type, string $value, string $key)
  • string $key: name of statement to set
  • string $value: , the value to give
  • $type
getAttribute (line 135)

Getter for any private attribute on this class

  • access: public
string getAttribute (string $name)
  • string $name
getMaxPages (line 289)

Count and returns how many of pages in resultset with current itemsPerpage value

  • access: public
integer getMaxPages ()
getNumRows (line 275)

Count items founded with query COUNT(*)

  • access: public
integer getNumRows ()
search (line 304)

Proceed to serach and returns the array of results, null if none founded. All search options had been set yet.

  • access: public
array(CMS_resources_cms_news) search ()
setAttribute (line 148)

Setter for any private attribute on this class

  • access: public
void setAttribute (string $name, $value $value)
  • string $name: name of attribute to set
  • $value $value: , the value to give
_buildSQL (line 220)

Prepares and stores SQL query from given attributes

  • access: private
string _buildSQL ()
_getResultsCount (line 246)

Count how many results can be returned by query

  • access: private
string _getResultsCount ()
_sanitizeSQLString (line 263)

Cleans a value submited by user before givening it to SQL.

  • access: private
string _sanitizeSQLString ( $s, string $s,)
  • string $s,: the string to clean
  • $s

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants

Documentation generated on Wed, 15 Feb 2012 15:30:40 +0100 by phpDocumentor 1.4.3