Documentation

MergeFunction extends BaseFunction
in package

Merge two or more result sets.

NOTE that this only works on CEO result sets and will not function on compatibility models.

Table of Contents

__construct()  : mixed
getDI()  : mixed
getFunctionName()  : string
Return function name
getFunctionOptions()  : mixed
handle()  : mixed
Fetch some [dehydrated](https://stackoverflow.com/questions/6991135/what-does-it-mean-to-hydrate-an-object) data.

Methods

__construct()

public __construct() : mixed
Return values
mixed

getFunctionName()

Return function name

public getFunctionName() : string
Return values
string

getFunctionOptions()

public getFunctionOptions() : mixed
Return values
mixed

handle()

Fetch some [dehydrated](https://stackoverflow.com/questions/6991135/what-does-it-mean-to-hydrate-an-object) data.

public handle(mixed $mergable, mixed $key[, mixed $direction = -1 ]) : mixed
{%
    set hp = fetch('article')
                .wherePublished()
                .limit(10)
                .findByTags(['homepage'])
%}
{%
    set sports = fetch('article')
                .wherePublished()
                .limit(10)
                .findByTags(['sports'])
%}
{% set items = merge([hp, sports], 'published_at') %}
{% for item in items %}
    {{ macros.rssItem(item) }}
{% endfor %}
Parameters
$mergable : mixed
$key : mixed
$direction : mixed = -1
Tags
CeoDocInclude

(as='fetch')

Return values
mixed

Search results