Documentation

PostFluentFetch extends BaseFluentFetch
in package

Provides extra sugar for post fetches

Tags
CeoDocs

(page='twigFetch', title='post')

Table of Contents

$builder  : mixed
$parentModel  : mixed
$_bindStack  : mixed
__call()  : mixed
__construct()  : mixed
andWhereIn()  : mixed
andWherePublished()  : Builder
Provides syntactically consistent andWherePublished
find()  : mixed
Execute the query and return objects
findByAuthors()  : array<string|int, mixed>
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.
findByTags()  : array<string|int, mixed>
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.
findFirst()  : mixed
findInPath()  : Collection
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
first()  : mixed
Execute the query, automatically limiting to one and return the first result
getBinds()  : mixed
Get binds reference
mergeBinds()  : array<string|int, mixed>
Merge binds
order()  : Builder
Provide an overload for the "orderBy" method
setBinds()  : mixed
Store binds reference for later
whereIn()  : Builder
Provides syntactically consistent andWhereIn handlers
wherePublished()  : self
Handle appropriate selection logic for published posts ``` {% set posts = fetch('post').wherePublished().find() %} ``` Internally, this is just looking at `published_at <= NOW()`

Properties

Methods

__call()

public __call(mixed $f, mixed $args) : mixed
Parameters
$f : mixed
$args : mixed
Return values
mixed

andWhereIn()

public andWhereIn(mixed $key, mixed $values) : mixed
Parameters
$key : mixed
$values : mixed
Return values
mixed

andWherePublished()

Provides syntactically consistent andWherePublished

public andWherePublished() : Builder
Return values
Builder

find()

Execute the query and return objects

public find([mixed $params = null ]) : mixed
Parameters
$params : mixed = null
Return values
mixed

Result set of Phalcon models

findByAuthors()

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.

public findByAuthors([mixed $authors = [] ][, mixed $mode = 'AND' ][, mixed $binds = null ]) : array<string|int, mixed>
Parameters
$authors : mixed = []
$mode : mixed = 'AND'
$binds : mixed = null
Tags
CeoDocsInclude
Return values
array<string|int, mixed>

findByTags()

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.

public findByTags([mixed $tags = [] ][, mixed $mode = 'AND' ][, mixed $binds = null ]) : array<string|int, mixed>

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
$tags : mixed = []
$mode : mixed = 'AND'
$binds : mixed = null
Tags
CeoDocsInclude
Return values
array<string|int, mixed>

findFirst()

public findFirst([mixed $params = null ]) : mixed
Parameters
$params : mixed = null
Return values
mixed

findInPath()

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

public findInPath(mixed $path[, mixed $mode = '=' ]) : Collection
  • = 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 : mixed
$mode : mixed = '='
Return values
Collection

first()

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

public first([mixed $binds = null ]) : mixed
Parameters
$binds : mixed = null
Return values
mixed

Result set

getBinds()

Get binds reference

public getBinds() : mixed
Return values
mixed

mergeBinds()

Merge binds

public mergeBinds([array<string|int, mixed> $binds = [] ]) : array<string|int, mixed>
Parameters
$binds : array<string|int, mixed> = []
Return values
array<string|int, mixed>

order()

Provide an overload for the "orderBy" method

public order() : Builder
Return values
Builder

setBinds()

Store binds reference for later

public setBinds(mixed $binds) : mixed
Parameters
$binds : mixed
Return values
mixed

whereIn()

Provides syntactically consistent andWhereIn handlers

public whereIn(mixed $key, mixed $values) : Builder
Parameters
$key : mixed
$values : mixed
Return values
Builder

wherePublished()

Handle appropriate selection logic for published posts ``` {% set posts = fetch('post').wherePublished().find() %} ``` Internally, this is just looking at `published_at <= NOW()`

public wherePublished() : self
Tags
CeoDocsInclude
Return values
self

Search results