コード例 #1
0
ファイル: Tab.php プロジェクト: picon/picon-framework
 /**
  *
  * @param string $name
  * @param closure $newMethod 
  */
 public function __construct($name, $newMethod)
 {
     Args::isString($name, 'name');
     Args::callBackArgs($newMethod, 1, 'newMethod');
     $this->name = $name;
     $this->newMethod = new SerializableClosure($newMethod);
 }
コード例 #2
0
 /**
  * Saves a resource to the cache.
  * @param type $name
  * @param type $resource
  * @param type $scope 
  */
 public static function saveResource($name, $resource, $scope)
 {
     Args::isString($name, 'name');
     $instance = self::get();
     $dir = $instance->getDirectoryForScope($scope);
     $instance->internalSaveResource($dir, $name, $resource);
 }
コード例 #3
0
 public function __construct($event, $callback)
 {
     parent::__construct();
     Args::isString($event, 'event');
     Args::callBackArgs($callback, 1, 'callback');
     $this->event = $event;
     $this->callback = $callback;
 }
コード例 #4
0
 /**
  *
  * @param type $name
  * @param type $function 
  * @param ... args the names of the arguments the javascript function should take
  */
 public function __construct($name, $function)
 {
     parent::__construct($name);
     Args::isString($function, 'function');
     $this->function = $function;
     $args = func_get_args();
     for ($i = 2; $i < count($args); $i++) {
         array_push($this->args, $args[$i]);
     }
 }
コード例 #5
0
 /**
  *
  * @param Tab $tab
  * @param closure $newMethod 
  */
 public function addTab($tab, $newMethod = null)
 {
     if ($tab instanceof Tab) {
         array_push($this->tabs, $tab);
     } else {
         Args::isString($tab, 'tab');
         Args::callBackArgs($newMethod, 1, 'newMethod');
         array_push($this->tabs, new Tab($tab, $newMethod));
     }
 }
コード例 #6
0
 /**
  *
  * @param type $name
  * @param type $function 
  * @param ... args the names of the arguments the javascript function should take
  */
 public function __construct($name, $callback, $function)
 {
     parent::__construct($name);
     Args::isString($function, 'function');
     Args::callBackArgs($callback, 1, 'callback');
     $this->callback = new SerializableClosure($callback);
     $this->function = $function;
     $args = func_get_args();
     for ($i = 3; $i < count($args); $i++) {
         array_push($this->args, $args[$i]);
     }
 }
コード例 #7
0
 public function __construct($name)
 {
     Args::isString($name, 'name');
     $this->name = $name;
 }
コード例 #8
0
 public function __construct($name, $value)
 {
     parent::__construct($name, $value);
     Args::isString($value, 'value');
     $this->value = $value;
 }
コード例 #9
0
 public function __construct($url)
 {
     Args::isString($url, 'url');
     $this->url = $url;
 }
コード例 #10
0
 public function __construct($attributeName, Model $value, $seperator)
 {
     parent::__construct($attributeName, $value);
     Args::isString($seperator, 'seperator');
     $this->seperator = $seperator;
 }
コード例 #11
0
ファイル: Component.php プロジェクト: picon/picon-framework
 /**
  * Create a new component. Any overrides of the constructor must call the super.
  * @param string $id the ID of this component
  */
 public function __construct($id, Model $model = null)
 {
     Args::isString($id, 'id');
     $this->id = $id;
     $this->model = $model;
     PiconApplication::get()->getComponentInstantiationListener()->onInstantiate($this);
 }
コード例 #12
0
 /**
  *
  * @param string $pattern The regular expression
  */
 public function __construct($pattern)
 {
     Args::isString($pattern, 'pattern');
     $this->pattern = $pattern;
 }
コード例 #13
0
 public function __construct($file, Identifier $identifier)
 {
     Args::isString($file, 'file');
     $this->file = $file;
     $this->identifier = $identifier;
 }