vendor/bundles/Pagerfanta/View/ViewFactoryInterface.php
author cavaliet
Fri, 21 Oct 2011 17:10:54 +0200
changeset 15 99ad73ef7385
permissions -rw-r--r--
first step for tag list and add Pagerfanta for paginator

<?php

/*
 * This file is part of the Pagerfanta package.
 *
 * (c) Pablo Díez <pablodip@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Pagerfanta\View;

use Pagerfanta\PagerfantaInterface;

/**
 * ViewFactoryInterface.
 *
 * @author Pablo Díez <pablodip@gmail.com>
 *
 * @api
 */
interface ViewFactoryInterface
{
    /**
     * Sets a view.
     *
     * @param string        $name The view name.
     * @param ViewInterface $view The view.
     */
    function set($name, ViewInterface $view);

    /**
     * Returns whether a view exists or not.
     *
     * @param string $name The name.
     *
     * @return Boolean Whether a view exists or not.
     *
     * @api
     */
    function has($name);

    /**
     * Adds views.
     *
     * @param array $views An array of views.
     *
     * @api
     */
    function add(array $views);

    /**
     * Returns a view.
     *
     * @param string $name The name.
     *
     * @return ViewInterface The view.
     *
     * @throws \InvalidArgumentException If the view does not exist.
     *
     * @api
     */
    function get($name);

    /**
     * Returns all the views.
     *
     * @return array The views.
     */
    function all();

    /**
     * Removes a view.
     *
     * @param string $name The name.
     *
     * @throws \InvalidArgumentException If the view does not exist.
     *
     * @api
     */
    function remove($name);

    /**
     * Clears the views.
     *
     * @api
     */
    function clear();
}