PHP Class ImageSearch

ファイルを表示 Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$m_imageData
$m_imageOffset
$m_isSearch
$m_itemsPerPage
$m_numImagesFound
$m_orderBy
$m_orderDirection
$m_orderQuery
$m_searchString
$m_whereGroups
$m_whereQuery

Public Methods

Method Description
ImageSearch ( string $p_searchString, string $p_orderBy, string $p_orderDirection = 'ASC', integer $p_offset, integer $p_itemsPerPage ) This class can search for images matching specific criteria.
getImages ( ) : array Return the images that were found.
getImagesPerPage ( ) : integer The current value for the number of images shown per page.
getNumImagesFound ( ) : integer Return the total number of images that match the search.
run ( ) : array Execute the search and return the results.
setFilter ( $col, $val, $out = false ) constructor
setImagesPerPage ( integer $p_value ) : void Set the max number of images to return from the run() function.

Method Details

ImageSearch() public method

Give the search criteria in the contructor, then call the run() function to execute the search and get an array of the images found.
public ImageSearch ( string $p_searchString, string $p_orderBy, string $p_orderDirection = 'ASC', integer $p_offset, integer $p_itemsPerPage )
$p_searchString string The string to search for.
$p_orderBy string Which column to order the results by. Can be one of ["description"|"photographer"|"place"|"date"| "inuse"|"id"|"time_create"|"last_modified"]
$p_orderDirection string Order by increasing or decreasing values. Can be ["ASC"|"DESC"]
$p_offset integer Return results starting from the given offset.
$p_itemsPerPage integer The number of results to return.

getImages() public method

Return the images that were found.
public getImages ( ) : array
return array

getImagesPerPage() public method

The current value for the number of images shown per page.
public getImagesPerPage ( ) : integer
return integer

getNumImagesFound() public method

Note that this may be different than the total number of images returned by run() or getImages() because that array is limited to the set "images per page". The number returned by this function is the total number of images without that restriction.
public getNumImagesFound ( ) : integer
return integer

run() public method

Execute the search and return the results.
public run ( ) : array
return array An array of Image objects.

setFilter() public method

constructor
public setFilter ( $col, $val, $out = false )

setImagesPerPage() public method

Set the max number of images to return from the run() function.
public setImagesPerPage ( integer $p_value ) : void
$p_value integer
return void

Property Details

$m_imageData public_oe property

public $m_imageData

$m_imageOffset public_oe property

public $m_imageOffset

$m_isSearch public_oe property

public $m_isSearch

$m_itemsPerPage public_oe property

public $m_itemsPerPage

$m_numImagesFound public_oe property

public $m_numImagesFound

$m_orderBy public_oe property

public $m_orderBy

$m_orderDirection public_oe property

public $m_orderDirection

$m_orderQuery public_oe property

public $m_orderQuery

$m_searchString public_oe property

public $m_searchString

$m_whereGroups public_oe property

public $m_whereGroups

$m_whereQuery public_oe property

public $m_whereQuery