phpDocumentor SGL
cms
[ class tree: SGL ] [ index: SGL ] [ all elements ]

Class: SGL_Finder

Source Location: /lib/Finder.php

Class SGL_Finder

Class Overview

Implements interfaces:

A factory object that allows building a finder for various framework resources, eg: files, content, etc.

Example to get content of a type and by a certain owner

  1.  $aReviews SGL_Finder::factory('content')
  2.    ->addFilter('type''RestaurantReview')
  3.    ->addFilter('createdBy'SGL_Session::getUid())
  4.    ->retrieve();

Example to get files within a date range and of a certain extension

  1.  $aFiles SGL_Finder::factory('file')
  2.    ->addFilter('directory''/foo/bar/baz')
  3.    ->addFilter('extension''php')
  4.    ->addFilter('startDate''2006/05/11')
  5.    ->addFilter('endDate''2006/11/11')
  6.    ->retrieve();

Located in /lib/Finder.php [line 56]



		
		
		
		

Properties

Methods

[ Top ]
Descendants
Child Class Description
SGL_Finder_Attriblist Finder's attribute list driver.
SGL_Finder_Content Enter description here...
SGL_Finder_Contenttype Enter description here...
SGL_Finder_File Enter description here...
SGL_Finder_Tag Finds tags (suggest)

[ Top ]
Property Summary
mixed   $_aAttributes  
mixed   $_aFilters  
mixed   $_aTypeIds  
mixed   $_paginated  

[ Top ]
Method Summary
static SGL_Filter   factory()   Used to create concrete Finder implementations.
SGL_Finder   addFilter()   Used to add filters and build dynamic Finder objects.
array   getAttributeFilters()   Returns an array of attribute filters.
void   getFilters()   Returns an array of the Finder's filters.
Pager   getPager()   Gets Pager object.
SGL_Finder   paginate()   Prepares results for pagination.
array();   retrieve()   Returns the array collection of content objects.
void   setPager()   Sets up Pager object.
array   _maintainPagerState()   Retrieves and maintains pager options.
string   _prepareAttribConstraint()   Prepare constraint to match against attribute props.
string   _prepareCategoryConstraint()   Enter description here...
string   _prepareContentConstraint()   Prepare constraint to match against attribute props
mixed   _prepareLimit()   Get limit value.
array   _prepareOrdering()   Prepare ordering.

[ Top ]
Properties
mixed   $_aAttributes = array() [line 59]
API Tags:
Access:  protected


[ Top ]
mixed   $_aFilters = array() [line 58]
API Tags:
Access:  protected


[ Top ]
mixed   $_aTypeIds = array() [line 60]
API Tags:
Access:  protected


[ Top ]
mixed   $_paginated = false [line 61]
API Tags:
Access:  protected


[ Top ]
Methods
static method factory  [line 69]

  static SGL_Filter factory( string $handler  )

Used to create concrete Finder implementations.

Parameters:
string   $handler: 

API Tags:
Access:  public


[ Top ]
addFilter  [line 94]

  SGL_Finder addFilter( string $filterName, string $filterValue  )

Used to add filters and build dynamic Finder objects.

Parameters:
string   $filterName: 
string   $filterValue: 

API Tags:
Access:  public


Implementation of:
SGL_CmsFindable::addFilter()

Redefined in descendants as:

[ Top ]
getAttributeFilters  [line 131]

  array getAttributeFilters( )

Returns an array of attribute filters.


API Tags:
Access:  public


[ Top ]
getFilters  [line 121]

  void getFilters( )

Returns an array of the Finder's filters.


API Tags:
Access:  public


[ Top ]
getPager  [line 502]

  Pager getPager( )

Gets Pager object.


API Tags:
Access:  public


[ Top ]
paginate  [line 448]

  SGL_Finder paginate( [array $pagerOptions = array()]  )

Prepares results for pagination.

Parameters:
array   $pagerOptions: 

API Tags:
Access:  public


[ Top ]
retrieve  [line 112]

  array(); retrieve( )

Returns the array collection of content objects.


API Tags:
Access:  public


Implementation of:
SGL_CmsFindable::retrieve()

Redefined in descendants as:

[ Top ]
setPager  [line 460]

  void setPager( [array $pagerOptions = array()]  )

Sets up Pager object.

Parameters:
array   $pagerOptions: 

API Tags:
Access:  public


[ Top ]
_maintainPagerState  [line 514]

  array _maintainPagerState( )

Retrieves and maintains pager options.


API Tags:
Return:  $perPage
Access:  protected


[ Top ]
_prepareAttribConstraint  [line 250]

  string _prepareAttribConstraint( )

Prepare constraint to match against attribute props.

Valid keys from $this->_aAttributes: name operator value


API Tags:
Return:  sql query or empty string $ret = " AND at.name = 'body' AND ad.value = 'And this is some richtext'";
Access:  protected

Information Tags:
Todo:  clean up quoting

[ Top ]
_prepareCategoryConstraint  [line 415]

  string _prepareCategoryConstraint( )

Enter description here...


API Tags:
Access:  protected


[ Top ]
_prepareContentConstraint  [line 149]

  string _prepareContentConstraint( )

Prepare constraint to match against attribute props

Valid keys from $this->_aFilters: typeId createdBy status sortBy sortOrder


API Tags:
Return:  sql query or empty string $ret = "WHERE c.content_type_id = 1";
Access:  protected


[ Top ]
_prepareLimit  [line 383]

  mixed _prepareLimit( )

Get limit value.


API Tags:
Access:  protected


[ Top ]
_prepareOrdering  [line 330]

  array _prepareOrdering( )

Prepare ordering.

Valid keys from $this->_aFilters: sortOrder sortBy


API Tags:
Access:  protected


[ Top ]

Documentation generated on Thu, 25 Dec 2008 22:04:53 +0000 by phpDocumentor 1.4.1