Source for file AppFactory.php

Documentation is available at AppFactory.php

  1. <?php
  2.     class miAppFactory {
  3.         protected static $_appFactory;
  4.         
  5.         protected $_state;
  6.         
  7.         /**
  8.          * Return reference to the app factory object
  9.          *
  10.          * @return miAppFactory 
  11.          */
  12.         public static function singleton()
  13.         {
  14.             if (!miAppFactory::$_appFactory)
  15.                 miAppFactory::$_appFactory new miAppFactory;
  16.             return miAppFactory::$_appFactory;
  17.         }
  18.         
  19.         /**
  20.          * Set new app factory object
  21.          * This method is used to change the default miAppFactory
  22.          *
  23.          * @param miAppFactory $appFactory 
  24.          */
  25.         public static function setAppFactory(miAppFactory $appFactory)
  26.         {
  27.             miAppFactory::$_appFactory $appFactory;
  28.         }
  29.         
  30.         /**
  31.          * Returns miState object
  32.          *
  33.          * @return miState 
  34.          */
  35.         public function getStateObj()
  36.         {
  37.             if (!$this->_state)
  38.                 $this->_state = new miState;
  39.             return $this->_state;
  40.         }
  41.     }
  42. ?>

Documentation generated on Thu, 08 May 2008 16:57:07 +0300 by phpDocumentor 1.4.1