org-puremvc-php-multicore
[ class tree: org-puremvc-php-multicore ] [ index: org-puremvc-php-multicore ] [ all elements ]

Source for file IController.php

Documentation is available at IController.php

  1. <?php
  2. /**
  3.  * PureMVC Multicore Port to PHP
  4.  *
  5.  * Partly based on PureMVC Port to PHP by:
  6.  * - Omar Gonzalez <omar@almerblank.com>
  7.  * - and Hasan Otuome <hasan@almerblank.com>
  8.  *
  9.  * Created on Jully 24, 2009
  10.  *
  11.  * @version 1.0
  12.  * @author Michel Chouinard <michel.chouinard@gmail.com>
  13.  * @copyright PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved.
  14.  * @license http://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0 Unported License
  15.  * @package org.puremvc.php.multicore
  16.  *
  17.  */
  18. /**
  19.  *
  20.  */
  21.  
  22. require_once 'org/puremvc/php/multicore/interfaces/INotification.php';
  23.  
  24. /**
  25.  * The interface definition for a PureMVC Controller.
  26.  *
  27.  * In PureMVC, an <b>IController</b> implementor
  28.  * follows the 'Command and Controller' strategy, and
  29.  * assumes these responsibilities:
  30.  *
  31.  * - Remembering which <b>ICommand</b>s are intended to handle
  32.  *   which <b>INotifications</b>.
  33.  * - Registering itself as an <b>IObserver</b> with the <b>IView</b>
  34.  *   for each <b>INotification</b> that it has an <b>ICommand</b>
  35.  *   mapping for.
  36.  * - Creating a new instance of the proper <b>ICommand</b> to handle
  37.  *   a given <b>INotification</b> when notified by the <b>IView</b>.
  38.  * - Calling the <b>ICommand</b>'s <b>execute</b> method, passing
  39.  *   in the <b>INotification</b>.
  40.  *
  41.  * @see INotification
  42.         org\puremvc\php\multicore\interfaces\INotification.php
  43.  * @see ICommand
  44.         org\puremvc\php\multicore\interfaces\ICommand.php
  45.  * @package org.puremvc.php.multicore
  46.  *
  47.  */
  48. interface IController
  49. {
  50.     /**
  51.      * Register Command
  52.      *
  53.      * Register a particular <b>ICommand</b> class as the handler
  54.      * for a particular <b>INotification</b>.
  55.      *
  56.      * @param string $notificationName Name of the <b>INotification</b>.
  57.      * @param string $commandClassRef Class name of the <b>ICommand</b> implementation to register.
  58.      * @return void 
  59.      */
  60.     public function registerCommand$notificationName$commandClassRef);
  61.  
  62.     /**
  63.      * Execute Command
  64.      *
  65.      * Execute the <b>ICommand</b> previously registered as the
  66.      * handler for <b>INotification</b>s with the given notification name.
  67.      *
  68.      * @param INotification $notification The <b>INotification</b> to execute the associated <b>ICommand</b> for.
  69.      * @return void 
  70.      */
  71.     public function executeCommandINotification $notification );
  72.  
  73.     /**
  74.      * Remove Command
  75.      *
  76.      * Remove a previously registered <b>ICommand</b> to <b>INotification</b> mapping.
  77.      *
  78.      * @param string $notificationName Name of the <b>INotification</b> to remove the <b>ICommand</b> mapping for.
  79.      * @return void 
  80.      */
  81.     public function removeCommand$notificationName );
  82.  
  83.     /**
  84.      * Has Command
  85.      *
  86.      * Check if a <b>Command</b> is registered for a given <b>INotification</b>
  87.      *
  88.      * @param string $notificationName Name of the <b>INotification</b> to check for.
  89.      * @return bool Boolean: Whether a <b>Command</b> is currently registered for the given <var>notificationName</var>.
  90.      */
  91.     public function hasCommand$notificationName );
  92.  
  93. }

Documentation generated on Mon, 03 Aug 2009 04:57:54 +0000 by phpDocumentor 1.4.2