PHP code example of aplia / filter

1. Go to this page and download the library: Download aplia/filter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aplia / filter example snippets


\eZContentObjectTreeNode::subTreeByNodeId(
    array(
        'Depth' => 20,
        'Limit' => 10,
        'SortBy' => ['published', false],
        'ClassFilterType' => 'nd' => 'OR',
                'attrs' => array(
                )
            ),
        ],
    ),
    2
);

['name', 'foo']

['my_class/size:>', 5]

['cond' => 'and'/'or', 'attrs' => [...]

[
    'name' => 'foo',
    'folder/title' => 'bar',
]

[
    ['name', 'foo'],
    ['folder/title' => 'bar'],
]

[
    [['folder/title', 'article/title'] => 'bar'],
]

[
    [
        'cond' => 'or',
        'attrs' => [
            'folder/title' => 'bar',
            'article/'title' => 'bar',
        ],
    ]
]

[
    ['folder/is_public', true],
    [
        'cond' => 'or',
        'attrs' => [
            'folder/title' => 'bar',
            'article/'title' => 'bar',
        ],
    ],
    [
        'call' => ['MyClass', 'makeFilter'],
    ]
]

['folder/name', '=', 'A', ['pre' => 'first_letter']]


class MyClass
{
    public static firstLetter($field)
    {
        return "SUBSTRING($field, 1, 1)";
    }
}
eztemplate
{fetch('content', 'list',
      hash(
        'parent_node_id', 2,
        'depth', 20,
        'limit', 10,
        'sort_by', array('published', false()),
        'class_filter_type', '('article/type'), $type),
                )
            )
        )
    )}