factory() public static method

Attempts to return a concrete Kronolith_FreeBusy_View instance based on $view.
public static factory ( string $view ) : mixed
$view string The type of concrete Kronolith_FreeBusy_View subclass to return.
return mixed The newly created concrete Kronolith_FreeBusy_View instance, or false on an error.
Ejemplo n.º 1
0
Archivo: View.php Proyecto: horde/horde
 /**
  * Attempts to return a reference to a concrete Kronolith_FreeBusy_View
  * instance based on $view.  It will only create a new instance if no
  * Kronolith_FreeBusy_View instance with the same parameters currently
  * exists.
  *
  * This method must be invoked as:
  * $var = &Kronolith_FreeBusy_View::singleton()
  *
  * @param string $view  The type of concrete Kronolith_FreeBusy_View
  *                      subclass to return.
  *
  * @return mixed  The created concrete Kronolith_FreeBusy_View instance, or
  *                false on an error.
  */
 public static function &singleton($view)
 {
     static $instances = array();
     if (!isset($instances[$view])) {
         $instances[$view] = Kronolith_FreeBusy_View::factory($view);
     }
     return $instances[$view];
 }