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


PHP Object::__set方法代碼示例

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


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

示例1: __set

 public function __set($name, $value)
 {
     $val = \strtoupper($name);
     if (\defined(self::OPT . $val)) {
         return $this->setOption(constant(self::OPT . $val), $value);
     }
     if ('HEADER_OUT' === $val) {
         return $this->setOption(CURLINFO_HEADER_OUT, $value);
     }
     return parent::__set($name, $value);
 }
開發者ID:rokerkony,項目名稱:Exchange,代碼行數:11,代碼來源:CUrl.php

示例2: __set

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

示例3: __set

 public function __set($name, $value)
 {
     if (parent::__isset($name)) {
         parent::__set($name, $value);
     } else {
         $this->data->{$name} = $value;
     }
 }
開發者ID:redwormik,項目名稱:fakeorm,代碼行數:8,代碼來源:Entity.php

示例4: __set

 /**
  * Magic setter to $this->data
  * @param string $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     try {
         parent::__set($name, $value);
     } catch (MemberAccessException $e) {
         $this->data[$name] = $value;
     }
 }
開發者ID:lucien144,項目名稱:Restful,代碼行數:13,代碼來源:Resource.php

示例5: __set

 /**
  * Setter proměnných.
  * @param mixed $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     parent::__set($name, $value);
 }
開發者ID:JZechy,項目名稱:ZBox,代碼行數:9,代碼來源:BaseEntity.php

示例6: __set

 /**
  * Setter
  *
  * @param string $name
  * @param mixed $value
  * @return mixed
  * @throws MemberAccessException
  */
 public function __set($name, $value)
 {
     try {
         return $this->universalSetValue($name, $value);
     } catch (\MemberAccessException $e) {
         return parent::__set($name, $value);
     }
 }
開發者ID:nella,項目名稱:ActiveMapper,代碼行數:16,代碼來源:Proxy.php

示例7: __set

 /**
  * Sets value of a property. Do not call directly.
  * Tries to use dynamic setter for protected properties (reflection fields) if setter is not defined.
  *
  * @param  string  property name
  * @param  mixed   property value
  * @return void
  * @throws MemberAccessException if the property is not defined or is read-only
  */
 public function __set($name, $value)
 {
     try {
         parent::__set($name, $value);
     } catch (MemberAccessException $e) {
         if ($this->hasProtectedReflectionField($name)) {
             // intentionally not used __isset
             $this->{$name} = $value;
         } else {
             throw new MemberAccessException($e->getMessage() . " If you want to use dynamic setter for this property, make sure that property has visibility 'protected'.");
         }
     }
 }
開發者ID:romansklenar,項目名稱:nette-activeentity,代碼行數:22,代碼來源:ActiveEntity.php

示例8: __set

 /**
  * @param string $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     if ($this->isOption($name) && !property_exists($this, $name)) {
         $this->setOption($name, $value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:noikiy,項目名稱:Curl,代碼行數:12,代碼來源:CurlWrapper.php

示例9: __set

 public function __set($name, $value)
 {
     foreach ($this->getExtensions() as $extension) {
         /* @var $extension ExtensionObject */
         if ($extension->getReflection()->hasProperty($name)) {
             $property = $extension->getReflection()->getProperty($name);
             if ($property->isPublic() && !$property->isStatic()) {
                 $extension->{$name} = $value;
                 return;
             }
         }
         if (ObjectMixin::has($extension, $name)) {
             ObjectMixin::set($extension, $name, $value);
             return;
         }
     }
     return parent::__set($name, $value);
 }
開發者ID:jsmitka,項目名稱:ExtensionObjects,代碼行數:18,代碼來源:ExtensibleObject.php


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