CmsLayoutTemplateQuery
extends CmsDbQueryBase
in package
A class to represent a template query, and its results.
This class accepts in it's constructor an array (or a comma separated string, of filter arguments).
Accepted filter arguments are:
o:string - The originator name
i:##,##,## - A list of template id's
t:## - A template type id
c:## - A template category id.
d:## - A design id
u:## - A template owner id
e:## - An additional editor id.
l:# - A boolean (0 or 1) indicating listable, or not listable.
Example:
$qry = new CmsTemplateQuery(array('o:'.get_userid(false)));
$qry->limit = 50;
$list = $qry->GetMatches();
Tags
Table of Contents
Properties
- $EOF : bool
- $fields : array<string|int, mixed>
- $limit : int
- $numpages : int
- $offset : int
- $sortby : string
- $sortorder : string
- $totalrows : int
- $_args : mixed
- This member stores the original arguments passed to the constructor and used when generating the query.
- $_limit : mixed
- The (integer) page limit.
- $_offset : mixed
- The current (integer) offset in the list of results
- $_rs : mixed
- This member stores the raw database resultset object.
- $_totalmatchingrows : mixed
- The total number of rows matching the query.
Methods
- __construct() : mixed
- Constructor
- Close() : mixed
- Close the resultset and free any resources it may have claimed.
- EOF() : bool
- Test if the resultset is pointing past the last record in the returned set
- execute() : mixed
- Execute the query given the parameters saved in the query
- GetMatchedTemplateIds() : array<string|int, mixed>
- Get the list of matched template ids
- GetMatches() : array<string|int, mixed>
- Get all matches
- GetObject() : CmsLayoutTemplate
- Get the template object for the current member of the resultset (if any).
- GetTemplate() : CmsLayoutTemplate
- Get the template object for the current member of the resultset (if any)
- MoveFirst() : mixed
- Modify the resultset object and point to the first record of the matched rows.
- MoveLast() : mixed
- Modify the resultset object and point to the last record of the matched rows.
- MoveNext() : mixed
- Modify the resultset object and point to the next record of the matched rows.
- RecordCount() : int
- Return the number of records that match the the current query subject to page limits, this method will return either the pagelimit or a lesser value.
- Rewind() : mixed
- Modify the resultset object and point to the first record of the matched rows.
- TotalMatches() : int
- Return the total number of matching records that match the current query
Properties
$EOF read-only
public
bool
$EOF
Indicates wether the resultset is past the last element (read only)
$fields read-only
public
array<string|int, mixed>
$fields
Associative array of the current row of the resultset (read only)
$limit read-only
public
int
$limit
The maximum number of rows to return in one resultset (read only)
$numpages read-only
public
int
$numpages
The total number of pages of rows that match the query (read only)
$offset read-only
public
int
$offset
The start offset of rows to return when executing the query (read only)
$sortby
public
string
$sortby
The sorting field for the returned results. Possible values are: id,name,created,modified,type. The default is to sort by template name.';
$sortorder
public
string
$sortorder
The sorting order for the returned results. Possible values are: ASC,DESC. The default is ASC.
$totalrows read-only
public
int
$totalrows
The total number of rows in the database that match the query (read only)
$_args
This member stores the original arguments passed to the constructor and used when generating the query.
protected
mixed
$_args
= array()
$_limit
The (integer) page limit.
protected
mixed
$_limit
= 1000
$_offset
The current (integer) offset in the list of results
protected
mixed
$_offset
= 0
$_rs
This member stores the raw database resultset object.
protected
mixed
$_rs
= \null
$_totalmatchingrows
The total number of rows matching the query.
protected
mixed
$_totalmatchingrows
= \null
This value is populated after execute() is called.
Tags
Methods
__construct()
Constructor
public
__construct([mixed $args = '' ]) : mixed
Parameters
- $args : mixed = ''
-
Accepts an associative array (key=>value) with arguments for the query, or a comma separarated string of arguments.
Close()
Close the resultset and free any resources it may have claimed.
public
Close() : mixed
EOF()
Test if the resultset is pointing past the last record in the returned set
public
EOF() : bool
Return values
boolexecute()
Execute the query given the parameters saved in the query
public
execute() : mixed
o * @throws CmsInvalidDataException
Tags
GetMatchedTemplateIds()
Get the list of matched template ids
public
GetMatchedTemplateIds() : array<string|int, mixed>
This method calls the execute method.
Tags
Return values
array<string|int, mixed> —Array of integers
GetMatches()
Get all matches
public
GetMatches() : array<string|int, mixed>
This method calls the execute method
Return values
array<string|int, mixed> —Array of CmsLayoutTemplate objects
GetObject()
Get the template object for the current member of the resultset (if any).
public
& GetObject() : CmsLayoutTemplate
This method is not as efficient as GetMatches() when the resultset has multiple items.
This method calls the execute method.
Tags
Return values
CmsLayoutTemplateGetTemplate()
Get the template object for the current member of the resultset (if any)
public
& GetTemplate() : CmsLayoutTemplate
This method calls the execute method.
Tags
Return values
CmsLayoutTemplateMoveFirst()
Modify the resultset object and point to the first record of the matched rows.
public
MoveFirst() : mixed
If execute has not been called yet, this method will call it.
MoveLast()
Modify the resultset object and point to the last record of the matched rows.
public
MoveLast() : mixed
If execute has not been called yet, this method will call it.
MoveNext()
Modify the resultset object and point to the next record of the matched rows.
public
MoveNext() : mixed
If execute has not been called yet, this method will call it.
RecordCount()
Return the number of records that match the the current query subject to page limits, this method will return either the pagelimit or a lesser value.
public
RecordCount() : int
If execute has not already been called, this method will call it.
Return values
intRewind()
Modify the resultset object and point to the first record of the matched rows.
public
Rewind() : mixed
This is a synonym for MoveFirst()
If execute has not been called yet, this method will call it.
Tags
TotalMatches()
Return the total number of matching records that match the current query
public
TotalMatches() : int
If execute has not already been called, this method will call it.