class AdFluentFetch extends BaseFluentFetch

Fluent Fetcher for snworks:ad

Properties

protected $builder from BaseFluentFetch
protected $parentModel

Methods

__construct()

No description

setBinds($binds)

Store binds reference for later

getBinds()

Get binds reference

Builder
andWherePublished()

Provides syntactically consistent andWherePublished

wherePublished()

No description

Builder
whereIn(string $key, array $values)

Provides syntactically consistent andWhereIn handlers

andWhereIn($key, $values)

No description

Builder
order()

Provide an overload for the "orderBy" method

Collection
findInPath($path, $mode = '=')

Provide a simple interface to handle findInPath functionality to find articles that fall in a SSTS path classification. Modifiers allow you to change the search mode

array
findByTags(array $tags = [], string $mode = 'AND', array $binds = null)

Provide a simple interface to handle findByTags functionality

{% set article = fetch('article').wherePublished().findByTags(['foo', 'bar']) %}
{% set article = fetch('article').wherePublished().findByTags(['foo', 'bar'], 'NOT') %}

Sluggifies the name so "Top Stories" and "top-stories" are treated the same.

array
findByAuthors(array $authors = [], string $mode = 'AND', array $binds = null)

Provide a simple interface to handle findByAuthors functionality

{% set article = fetch('article').wherePublished().findByAuthors(['foo', 'bar']) %}

Sluggifies the name so "Top Stories" and "top-stories" are treated the same.

mixed
find($binds = NULL)

Execute the query and return objects

mixed
first($binds = null)

Execute the query, automatically limiting to one and return the first result

__call($f, $args)

No description

where(string $str)

Override where, most of these are looking for featured, so "status = 1" classifieds. That changes with the Entry method.

orderBy(string $str)

Handle proper sorting

Details

at line 21
__construct()

in BaseFluentFetch at line 24
setBinds($binds)

Store binds reference for later

Parameters

$binds

in BaseFluentFetch at line 32
getBinds()

Get binds reference

in BaseFluentFetch at line 41
Builder andWherePublished()

Provides syntactically consistent andWherePublished

Return Value

Builder

in BaseFluentFetch at line 46
wherePublished()

in BaseFluentFetch at line 59
Builder whereIn(string $key, array $values)

Provides syntactically consistent andWhereIn handlers

Parameters

string $key
array $values

Return Value

Builder

in BaseFluentFetch at line 63
andWhereIn($key, $values)

Parameters

$key
$values

in BaseFluentFetch at line 73
Builder order()

Provide an overload for the "orderBy" method

Return Value

Builder

in BaseFluentFetch at line 103
Collection findInPath($path, $mode = '=')

Provide a simple interface to handle findInPath functionality to find articles that fall in a SSTS path classification. Modifiers allow you to change the search mode

  • = Exact match (default)
  • > Ends with
  • < Starts with
  • ~ Contains
  • <> Does not contain
{# find articles where the ssts path matches 'sports/tennis' #}
{% set article = fetch('article').wherePublished().findInPath('sports/tennis') %}

{# find articles where the ssts path contains 'sports/tennis' anywhere #}
{% set article = fetch('article').wherePublished().findInPath('sports/tennis', '~') %}

Parameters

$path
$mode

Return Value

Collection

in BaseFluentFetch at line 153
array findByTags(array $tags = [], string $mode = 'AND', array $binds = null)

Provide a simple interface to handle findByTags functionality

{% set article = fetch('article').wherePublished().findByTags(['foo', 'bar']) %}
{% set article = fetch('article').wherePublished().findByTags(['foo', 'bar'], 'NOT') %}

Sluggifies the name so "Top Stories" and "top-stories" are treated the same.

Passing 'AND' or 'OR' for $mode will include tags, passing 'NOT' will exclude them, e.g. if you're looking for articles not tagged 'top-stories', use 'NOT' for $mode;

Parameters

array $tags Array of tag names
string $mode Mode 'AND', 'OR', or 'NOT' search
array $binds Binds

Return Value

array

in BaseFluentFetch at line 275
array findByAuthors(array $authors = [], string $mode = 'AND', array $binds = null)

Provide a simple interface to handle findByAuthors functionality

{% set article = fetch('article').wherePublished().findByAuthors(['foo', 'bar']) %}

Sluggifies the name so "Top Stories" and "top-stories" are treated the same.

Parameters

array $authors Array of author names
string $mode Mode 'AND', 'OR' or 'NOT' search
array $binds Binds

Return Value

array

at line 92
mixed find($binds = NULL)

Execute the query and return objects

Parameters

$binds

Return Value

mixed Result set of Phalcon models

in BaseFluentFetch at line 331
mixed first($binds = null)

Execute the query, automatically limiting to one and return the first result

Parameters

$binds

Return Value

mixed Result set

in BaseFluentFetch at line 343
__call($f, $args)

Parameters

$f
$args

at line 45
AdFluentFetch where(string $str)

Override where, most of these are looking for featured, so "status = 1" classifieds. That changes with the Entry method.

Parameters

string $str

Return Value

AdFluentFetch

at line 72
AdFluentFetch orderBy(string $str)

Handle proper sorting

Parameters

string $str

Return Value

AdFluentFetch