當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Nette\Object類代碼示例

本文整理匯總了PHP中Nette\Object的典型用法代碼示例。如果您正苦於以下問題:PHP Object類的具體用法?PHP Object怎麽用?PHP Object使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Object類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: register

 /**
  * Registers all object's events to matching methods
  * 
  * @param vBuilder\Object $object 
  */
 public function register(Nette\Object $object)
 {
     $rc = $object->getReflection();
     $rc2 = $this->getReflection();
     $publicProperties = $rc->getProperties(\ReflectionProperty::IS_PUBLIC);
     foreach ($publicProperties as $property) {
         $eventName = $property->getName();
         if (!preg_match('#^on[A-Z]#', $eventName)) {
             continue;
         }
         if ($rc2->hasMethod($eventName)) {
             array_push($object->{$eventName}, array($this, $eventName));
         }
     }
 }
開發者ID:vbuilder,項目名稱:framework,代碼行數:20,代碼來源:EventListener.php

示例2: register

 /**
  * Register TextInputCustomLabel
  * @param  string $control_name string
  * @return void
  */
 public static function register($control_name = 'addTextCustomLabel')
 {
     Nette\Object::extensionMethod('Nette\\Forms\\Container::' . $control_name, function ($form, $name, $label = NULL, array $items = NULL) {
         $control = new self($label, $items);
         return $form[$name] = $control;
     });
 }
開發者ID:ublaboo,項目名稱:controls,代碼行數:12,代碼來源:TextInputCustomLabel.php

示例3: register

 public static function register($controlName = 'addMultiSelectFileChoicer')
 {
     if (!is_string($controlName)) {
         throw new Exception(sprintf('Control name must be string, %s given', gettype($controlName)));
     }
     Nette\Object::extensionMethod('Nette\\Forms\\Container::' . $controlName, function ($form, $name, IManager $mediaManager, $namespace, $label = null, $withPrimary = true) {
         return $form[$name] = new \vojtabiberle\MediaStorage\Bridges\Nette\Forms\Controls\MultiSelectFileChoicer($mediaManager, $namespace, $label, $withPrimary);
     });
 }
開發者ID:vojtabiberle,項目名稱:MediaStorage,代碼行數:9,代碼來源:MultiSelectFileChoicer.php

示例4: register

 /**
  * Register NotTranslatableSelectBox
  * @param  string $control_name string
  * @return void
  */
 public static function register($control_name = 'addNotTranslatableSelect')
 {
     Nette\Object::extensionMethod('Nette\\Forms\\Container::' . $control_name, function ($form, $name, $label = NULL, array $items = NULL, $size = NULL) {
         $control = new self($label, $items);
         if ($size > 1) {
             $control->setAttribute('size', (int) $size);
         }
         return $form[$name] = $control;
     });
 }
開發者ID:ublaboo,項目名稱:controls,代碼行數:15,代碼來源:NotTranslatableSelectBox.php

示例5: register

 /**
  * @param string $controlName
  * @throws ImageStorageException
  */
 public static function register($controlName = 'addMultiImageUpload')
 {
     if (!is_string($controlName)) {
         throw new ImageStorageException(sprintf('Control name must be a string, %s given', gettype($controlName)));
     }
     Object::extensionMethod(Container::class . '::' . $controlName, function ($form, $name, $label = NULL, $namespace = NULL) {
         $control = new self($label);
         $control->setNamespace($namespace);
         return $form[$name] = $control;
     });
 }
開發者ID:webchemistry,項目名稱:images,代碼行數:15,代碼來源:MultiUpload.php

示例6: __call

 public function __call($name, $args = [])
 {
     if (method_exists($this->acl, $name)) {
         return call_user_func_array([$this->acl, $name], $args);
     }
     return parent::__call($name, $args);
 }
開發者ID:zaxcms,項目名稱:framework,代碼行數:7,代碼來源:Acl.php

示例7: __call

 /**
  * Allows calling $column->icon() instead of $column->setIcon (Same for title, class, ...)
  * @param  string $name
  * @param  array  $args
  * @return mixed
  */
 public function __call($name, $args)
 {
     $method_setter = 'set' . ucfirst($name);
     if (method_exists($this, $method_setter)) {
         return Nette\Utils\Callback::invokeArgs([$this, $method_setter], $args);
     }
     parent::__call($name, $args);
 }
開發者ID:JakubKontra,項目名稱:datagrid,代碼行數:14,代碼來源:Object.php

示例8: elseif

 /**
  * @param  string
  * @return string|NULL
  */
 public function &__get($name)
 {
     if (strtolower($name) === 'info') {
         return $this->info;
     } elseif (array_key_exists($name, $this->info)) {
         return $this->info[$name];
     }
     return parent::__get($name);
 }
開發者ID:milo,項目名稱:github-api-nette,代碼行數:13,代碼來源:User.php

示例9:

 public function &__get($name)
 {
     $service = $this->getService($name, false);
     if ($service) {
         return $service;
     }
     $object = parent::__get($name);
     return $object;
 }
開發者ID:pipaslot,項目名稱:rest,代碼行數:9,代碼來源:AContext.php

示例10:

 public function &__get($name)
 {
     $val = \strtoupper($name);
     if (\defined(self::INFO . $val)) {
         $a = $this->getInfo(constant(self::INFO . $val));
         return $a;
     }
     return parent::__get($name);
 }
開發者ID:rokerkony,項目名稱:Exchange,代碼行數:9,代碼來源:CUrl.php

示例11: __isset

 /**
  * @param string $name
  * @return bool
  */
 public function __isset($name)
 {
     $isset = parent::__isset($name);
     if ($isset) {
         return TRUE;
     }
     $data = $this->getData();
     return isset($data[$name]);
 }
開發者ID:lucien144,項目名稱:Restful,代碼行數:13,代碼來源:Input.php

示例12:

 /**
  * Returns user data value.
  * @param string property name
  * @return mixed
  */
 public function &__get($key)
 {
     if (parent::__isset($key)) {
         return parent::__get($key);
     } else {
         $data = $this->data->toArray();
         return $data[$key];
     }
 }
開發者ID:angelcam,項目名稱:angelcam-sdk-php,代碼行數:14,代碼來源:Identity.php

示例13: __call

 public function __call($methodName, $args)
 {
     if (preg_match('|.*getModel([a-zA-Z0-9]+).*|', $methodName, $mtch)) {
         if (class_exists('Model\\' . $mtch[1] . 'Model')) {
             return $this->modelLoader->loadModel($mtch[1] . 'Model');
         }
     } else {
         return parent::__call($methodName, $args);
     }
 }
開發者ID:jurasm2,項目名稱:bubo,代碼行數:10,代碼來源:BaseModel.php

示例14: __call

 /**
  * @param string $name
  * @param array $args
  * @return mixed
  */
 public function __call($name, $args)
 {
     $function = 'newrelic_' . self::convertCamelCaseToUnderscore($name);
     if (!extension_loaded('newrelic')) {
         return FALSE;
     }
     if (!function_exists($function)) {
         return parent::__call($name, $args);
     }
     return call_user_func_array($function, $args);
 }
開發者ID:damejidlo,項目名稱:newrelic,代碼行數:16,代碼來源:Client.php

示例15: __call

 public function __call($name, $args)
 {
     if (preg_match('~^create(Select|Update|Delete|Insert)$~', $name, $m)) {
         #query object factory
         $class = "Flunorette\\Queries\\{$m[1]}Query";
         $queryContext = new QueryContext(reset($args), $this);
         return new $class($queryContext);
     }
     return parent::__call($name, $args);
 }
開發者ID:icaine,項目名稱:flunorette,代碼行數:10,代碼來源:Connection.php


注:本文中的Nette\Object類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。