vendor/bundles/Pagerfanta/View/ViewFactoryInterface.php
changeset 15 99ad73ef7385
equal deleted inserted replaced
14:fc78844c8a76 15:99ad73ef7385
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * This file is part of the Pagerfanta package.
       
     5  *
       
     6  * (c) Pablo Díez <pablodip@gmail.com>
       
     7  *
       
     8  * For the full copyright and license information, please view the LICENSE
       
     9  * file that was distributed with this source code.
       
    10  */
       
    11 
       
    12 namespace Pagerfanta\View;
       
    13 
       
    14 use Pagerfanta\PagerfantaInterface;
       
    15 
       
    16 /**
       
    17  * ViewFactoryInterface.
       
    18  *
       
    19  * @author Pablo Díez <pablodip@gmail.com>
       
    20  *
       
    21  * @api
       
    22  */
       
    23 interface ViewFactoryInterface
       
    24 {
       
    25     /**
       
    26      * Sets a view.
       
    27      *
       
    28      * @param string        $name The view name.
       
    29      * @param ViewInterface $view The view.
       
    30      */
       
    31     function set($name, ViewInterface $view);
       
    32 
       
    33     /**
       
    34      * Returns whether a view exists or not.
       
    35      *
       
    36      * @param string $name The name.
       
    37      *
       
    38      * @return Boolean Whether a view exists or not.
       
    39      *
       
    40      * @api
       
    41      */
       
    42     function has($name);
       
    43 
       
    44     /**
       
    45      * Adds views.
       
    46      *
       
    47      * @param array $views An array of views.
       
    48      *
       
    49      * @api
       
    50      */
       
    51     function add(array $views);
       
    52 
       
    53     /**
       
    54      * Returns a view.
       
    55      *
       
    56      * @param string $name The name.
       
    57      *
       
    58      * @return ViewInterface The view.
       
    59      *
       
    60      * @throws \InvalidArgumentException If the view does not exist.
       
    61      *
       
    62      * @api
       
    63      */
       
    64     function get($name);
       
    65 
       
    66     /**
       
    67      * Returns all the views.
       
    68      *
       
    69      * @return array The views.
       
    70      */
       
    71     function all();
       
    72 
       
    73     /**
       
    74      * Removes a view.
       
    75      *
       
    76      * @param string $name The name.
       
    77      *
       
    78      * @throws \InvalidArgumentException If the view does not exist.
       
    79      *
       
    80      * @api
       
    81      */
       
    82     function remove($name);
       
    83 
       
    84     /**
       
    85      * Clears the views.
       
    86      *
       
    87      * @api
       
    88      */
       
    89     function clear();
       
    90 }