Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ActiveRecordProvider
  • CacheManager
  • Collection
  • Hooks
  • Module
  • Provider
  • TemplateResolver
  • View
  • ViewEditor
  • ViewEditorElement
  • ViewOptions
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@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 Icybee\Modules\Views;
13 
14 use ICanBoogie\PropertyNotReadable;
15 
16 /**
17  * Provides data for a view.
18  */
19 abstract class Provider
20 {
21     const RETURNS_ONE = 1;
22     const RETURNS_MANY = 2;
23     const RETURNS_OTHER = 3;
24 
25     protected $view;
26     protected $context;
27     protected $module;
28     protected $conditions;
29     protected $returns;
30 
31     public function __construct(View $view, \BlueTihi\Context $context, \ICanBoogie\Module $module, array $conditions, $returns)
32     {
33         $this->view = $view;
34         $this->context = $context;
35         $this->module = $module;
36         $this->conditions = $conditions;
37         $this->returns = $returns;
38     }
39 
40     public function __get($property)
41     {
42         static $readers = array('returns');
43 
44         if (in_array($property, $readers))
45         {
46             return $this->$property;
47         }
48 
49         throw new PropertyNotReadable($property);
50     }
51 
52     abstract public function __invoke();
53 
54     /**
55      * Alters the conditions.
56      *
57      * @param array $conditions
58      */
59     protected function alter_conditions(array $conditions)
60     {
61         return $conditions;
62     }
63 
64     /**
65      * Alters rendering context.
66      *
67      * @param array $context
68      */
69     protected function alter_context(\BlueTihi\Context $context, \ICanBoogie\ActiveRecord\Query $query, array $conditions)
70     {
71         return $context;
72     }
73 }
Autodoc API documentation generated by ApiGen 2.8.0