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

  • ActiveRecordCache
  • CollectDependenciesEvent
  • Connection
  • Connections
  • DateTimePropertySupport
  • Helpers
  • Hooks
  • Model
  • Models
  • Query
  • RunTimeActiveRecordCache
  • Statement
  • Table

Interfaces

  • ActiveRecordCacheInterface

Traits

  • CreatedAtProperty
  • DateTimeProperty
  • UpdatedAtProperty

Exceptions

  • ActiveRecordException
  • ConnectionAlreadyEstablished
  • ConnectionNotDefined
  • ConnectionNotEstablished
  • ModelAlreadyInstantiated
  • ModelNotDefined
  • RecordNotFound
  • ScopeNotDefined
  • StatementInvalid

Functions

  • get_model
 1 <?php
 2 
 3 /*
 4  * This file is part of the ICanBoogie 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 ICanBoogie\ActiveRecord;
13 
14 /**
15  * Returns the requested model.
16  *
17  * @param string $id Model identifier.
18  *
19  * @return Model
20  */
21 function get_model($id)
22 {
23     return Helpers::get_model($id);
24 }
25 
26 /**
27  * Patchable helpers of the ActiveRecord package.
28  */
29 class Helpers
30 {
31     static private $jumptable = [
32 
33         'get_model' => [ __CLASS__, 'get_model' ]
34 
35     ];
36 
37     /**
38      * Calls the callback of a patchable function.
39      *
40      * @param string $name Name of the function.
41      * @param array $arguments Arguments.
42      *
43      * @return mixed
44      */
45     static public function __callstatic($name, array $arguments)
46     {
47         return call_user_func_array(self::$jumptable[$name], $arguments);
48     }
49 
50     /**
51      * Patches a patchable function.
52      *
53      * @param string $name Name of the function.
54      * @param collable $callback Callback.
55      *
56      * @throws \RuntimeException is attempt to patch an undefined function.
57      */
58     static public function patch($name, $callback)
59     {
60         if (empty(self::$jumptable[$name]))
61         {
62             throw new \RuntimeException("Undefined patchable: $name.");
63         }
64 
65         self::$jumptable[$name] = $callback;
66     }
67 
68     /*
69      * Default implementations
70      */
71 
72     static private function get_model($id)
73     {
74         throw new \RuntimeException("The function " . __FUNCTION__ . "() needs to be patched.");
75     }
76 }
Autodoc API documentation generated by ApiGen 2.8.0