Get all static order conditions types
static array
getStaticOrderConditionTypes
()
Get all static where conditions types
static array
getStaticSearchConditionTypes
()
Constructor
CMS_object_search
__construct
($objectDefinition $objectDefinition, [boolean $public = false])
-
boolean
$public
-
$objectDefinition
$objectDefinition: CMS_poly_object_definition the current search object definition or the ID of the CMS_poly_object_definition
Builds order statement with a key and its value The key can be a known string or it can be a field id, this method will create statements in consequence
void
addOrderCondition
( $type, [string $direction = 'asc'], [ $operator = false], string $key)
-
string
$key: name of statement to set
-
string
$direction: , the direction to give (asc or desc, default is asc)
-
$type
-
$operator
Builds where statement with a key and its value The key can be a known string, this class will create statements in consequence or it can be a field id
void
addWhereCondition
( $type, string $value, [ $operator = false], string $key, string $operator,)
-
string
$key: name of statement to set
-
string
$value: , the value to give
-
string
$operator,: additional optional search operator
-
$type
-
$operator
Getter for any private attribute on this class
string
getAttribute
(string $name)
Count and returns how many of pages in resultset with current itemsPerpage value
integer
getMaxPages
()
Returns the next result in the current search results stack, false if no results left Search must be already done using search method and mode self::POLYMOD_SEARCH_RETURN_INDIVIDUALS_OBJECTS.
array(CMS_poly_object)
getNextResult
([$return, $return = self::POLYMOD_SEARCH_RETURN_OBJECTS], [boolean $loadSubObjects = false])
-
boolean
$loadSubObjects: : all the founded objects can load theirs own sub objects (default false) /!\ CAUTION : Pass this option to true can generate a lot of subqueries /!\
-
$return,
$return: the returned values in : self::POLYMOD_SEARCH_RETURN_OBJECTS for objetcs (default) self::POLYMOD_SEARCH_RETURN_OBJECTSLIGHT for light objects (without subobjects datas) self::POLYMOD_SEARCH_RETURN_OBJECTSLIGHT_EDITED for edited light objects. /!\ This method must not be used for objects which should be saved (used by getListOfNamesForObject only) /!\
Count items founded with query COUNT(*)
integer
getNumRows
()
Get all results score for current search
array
getScore
()
Does last result returned by method getNextResult is the last of the stack
boolean
isLastResult
()
Reset the results stack returned by the method getNextResult
void
resetResultStack
()
Proceed to search and returns the array of results, null if none founded. All search options had been set yet.
mixed
search
([$return, $return = self::POLYMOD_SEARCH_RETURN_OBJECTS], [boolean $loadSubObjects = false])
-
boolean
$loadSubObjects: : all the founded objects can load theirs own sub objects (default false) /!\ CAUTION : Pass this option to true can generate a lot of subqueries /!\
-
$return,
$return: the returned values in : self::POLYMOD_SEARCH_RETURN_IDS for array of ids sorted self::POLYMOD_SEARCH_RETURN_DATAS for db datas self::POLYMOD_SEARCH_RETURN_OBJECTS for objetcs (default) self::POLYMOD_SEARCH_RETURN_OBJECTSLIGHT for light objects (without subobjects datas) self::POLYMOD_SEARCH_RETURN_OBJECTSLIGHT_EDITED for edited light objects. /!\ This method must not be used for objects which should be saved (used by getListOfNamesForObject only) /!\ self::POLYMOD_SEARCH_RETURN_INDIVIDUALS_OBJECTS use this method to get individual results with method getNextResult
Setter for any private attribute on this class
void
setAttribute
(string $name, $value $value)
-
string
$name: name of attribute to set
-
$value
$value: , the value to give
Search items by xml definition. Return XML
string
soapSearch
([string $searchConditions = ''])
-
string
$searchConditions: XML definition to search with
Get all searched objects ids
array
_getIds
()
Get all searched objects (and subobjects) values
array
_getObjectValues
()
Get SQL tmp list of ids This method is used to avoid mysql crash because variable max_allowed_packet is too low
string
_getSQLTmpList
()
Get all subobjects values for searched objects results
array
_getSubObjectsIds
()
Sort and limit founded ids by orders and limit clauses This method limit results to existant objects too
array
_sortIds
()
Update temporary table with founded ids This method is used to avoid mysql crash because variable max_allowed_packet is too low
boolean
_updateTmpList
([array $ids = array()])
-
array
$ids: : the list of ids to update
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()