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

  • CacheManager
  • ConfigBlock
  • ConfigOperation
  • Content
  • DeleteBlock
  • EditBlock
  • HomeExcludeOperation
  • HomeIncludeOperation
  • Hooks
  • ManageBlock
  • Model
  • Module
  • Rendered
  • SaveOperation
  • Update20140330
  • ViewProvider

Traits

  • DateProperty
 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\Contents;
13 
14 use Icybee\Modules\Cache\Collection as CacheCollection;
15 use Icybee\Modules\Files\File;
16 
17 class Hooks
18 {
19     /*
20      * Events
21      */
22 
23     /**
24      * Adds the `contents.body` cache manager to the cache collection.
25      *
26      * @param CacheCollection\CollectEvent $event
27      * @param CacheCollection $collection
28      */
29     static public function on_cache_collection_collect(CacheCollection\CollectEvent $event, CacheCollection $collection)
30     {
31         $event->collection['contents.body'] = new CacheManager;
32     }
33 
34     /**
35      * The callback is called when the `Icybee\Modules\Files\File::move` is triggered, allowing us
36      * to update contents to the changed path of resources.
37      *
38      * @param File\MoveEvent $event
39      * @param File $target
40      */
41     static public function on_file_move(File\MoveEvent $event, File $target)
42     {
43         global $core;
44 
45         $core->models['contents']->execute
46         (
47             'UPDATE {self} SET `body` = REPLACE(`body`, ?, ?)', [ $event->from, $event->to ]
48         );
49     }
50 }
Autodoc API documentation generated by ApiGen 2.8.0