<?php
/**
 * Pi Engine (http://piengine.org)
 *
 * @link            http://code.piengine.org for the Pi Engine source repository
 * @copyright       Copyright (c) Pi Engine http://piengine.org
 * @license         http://piengine.org/license.txt BSD 3-Clause License
 */

namespace Module\Demo;

trigger_error(sprintf('The class is discouraged, move corresponding methods to relevant APIs - %s', __FILE__), E_USER_WARNING);

class Service
{
    protected static $module = 'demo';

    /**
     * Fetch content of an item from a type of moldule content
     * by calling Module\ModuleName\Service::content()
     *
     * @param array $variables Variables to be returned:
     *      title, summary, uid, user, etc.
     * @param array $conditions Associative array of conditions:
     *      item - item ID or ID list, module, type - optional, user, Where
     * @return array Associative array of returned content,
     *      or list of associative arry if $item is an array
     */
    public static function content(array $variables, array $conditions)
    {
        $module = empty($conditions['module'])
            ? static::$module : $conditions['module'];

        return [];
    }
}
