Add hook files - refs BT#9438

1.10.x
Imanol Losada 10 years ago
parent 05ae9e78b1
commit 99f462bc10
  1. 33
      main/inc/lib/hook/HookResubscribe.php
  2. 21
      main/inc/lib/hook/interfaces/HookResubscribeEventInterface.php
  3. 20
      main/inc/lib/hook/interfaces/HookResubscribeObserverInterface.php

@ -0,0 +1,33 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class HookResubscribe
* @var \SplObjectStorage $observers
*/
class HookResubscribe extends HookEvent implements HookResubscribeEventInterface
{
/**
* Constructor
*/
protected function __construct()
{
parent::__construct('HookResubscribe');
}
/**
* Update all the observers
* @param int $type
*
* @return int
*/
public function notifyResubscribe($type)
{
/** @var \HookResubscribeObserverInterface $observer */
$this->eventData['type'] = $type;
foreach ($this->observers as $observer) {
$observer->hookResubscribe($this);
}
return 1;
}
}

@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes
* @package chamilo.library.hook
*/
/**
* Interface HookResubscribeEventInterface
*/
interface HookResubscribeEventInterface extends HookEventInterface
{
/**
* Update all the observers
* @param int $type
*
* @return int
*/
public function notifyResubscribe($type);
}

@ -0,0 +1,20 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file contains all Hook interfaces and their relation.
* They are used for Hook classes
* @package chamilo.library.hook
*/
/**
* Interface ResubscribeHookInterface
*/
interface HookResubscribeObserverInterface extends HookObserverInterface
{
/**
* @param HookResubscribeObserverInterface $hook
*
* @return int
*/
public function hookResubscribe(HookResubscribeEventInterface $hook);
}
Loading…
Cancel
Save