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


PHP Nette\ObjectMixin類代碼示例

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


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

示例1: __call

 /**
  * Call to undefined method.
  * @param  string  method name
  * @param  array   arguments
  * @return mixed
  * @throws MemberAccessException
  */
 public function __call($name, $args)
 {
     $class = new Nette\Reflection\ClassType($this);
     if ($name === '') {
         throw new Nette\MemberAccessException("Call to class '{$class->name}' method without name.");
     }
     // event functionality
     if ($class->hasProperty($name)) {
         if (!$this->_eventSetupCalled) {
             $this->_eventSetupCalled = true;
             $this->eventSetup();
             $this->onEventSetup($this);
         }
         if (is_array($list = $this->{$name}) || $list instanceof \Traversable) {
             foreach ($list as $handler) {
                 callback($handler)->invokeArgs($args);
             }
         }
         return NULL;
     }
     // extension methods
     if ($cb = Nette\ObjectMixin::getExtensionMethod(get_class($this), $name)) {
         array_unshift($args, $this);
         return $cb->invokeArgs($args);
     }
     throw new Nette\MemberAccessException("Call to undefined method {$class->name}::{$name}().");
 }
開發者ID:vbuilder,項目名稱:framework,代碼行數:34,代碼來源:Object.php

示例2: __unset

 public function __unset($key)
 {
     $column = $this->formatColumnName($key);
     if (parent::__isset($column) || !ObjectMixin::has($this, $key)) {
         parent::__unset($column);
     } else {
         ObjectMixin::remove($this, $key);
     }
 }
開發者ID:fabik,項目名稱:database,代碼行數:9,代碼來源:ActiveRow.php

示例3: getItemValue

 /**
  * @param $item
  * @param $valueName
  * @return mixed
  */
 public function getItemValue($item, $valueName)
 {
     if (isset($this->columnAliases[$valueName])) {
         $getterPath = $this->columnAliases[$valueName]->getterPath;
     } else {
         $getterPath = $valueName;
     }
     $getters = explode('.', $getterPath);
     $value = $item;
     foreach ($getters as $getter) {
         $value = ObjectMixin::get($value, $getter);
     }
     return $value;
 }
開發者ID:natrim,項目名稱:gridito,代碼行數:19,代碼來源:DoctrineQueryBuilderModel.php

示例4: __call

 public function __call($name, $args)
 {
     return Nette\ObjectMixin::callProperty($this, $name, $args);
 }
開發者ID:TheTypoMaster,項目名稱:SPHERE-Framework,代碼行數:4,代碼來源:ClassType.php

示例5: __unset

 /**
  * Access to undeclared property.
  * @param  string  property name
  * @return void
  * @throws Nette\MemberAccessException
  */
 public function __unset($name)
 {
     Nette\ObjectMixin::remove($this, $name);
 }
開發者ID:genextwebs,項目名稱:dropbox-sample,代碼行數:10,代碼來源:CachingIterator.php

示例6: __isset

 public function __isset($name)
 {
     return ObjectMixin::has($this, $name);
 }
開發者ID:JPalounek,項目名稱:IconStore,代碼行數:4,代碼來源:ParameterReflection.php

示例7: __call

 /**
  * @param $method
  * @param $args
  */
 public function __call($method, $args)
 {
     ObjectMixin::call($this, $method, $args);
 }
開發者ID:peterzadori,項目名稱:movi,代碼行數:8,代碼來源:Repository.php

示例8: __call

Nette\Object{public$name;public$value;public$static;public$visibility='public';public$documents=array();function
__call($name,$args){return
Nette\ObjectMixin::callProperty($this,$name,$args);}}}namespace Nette\Utils{use
開發者ID:JanTvrdik,項目名稱:NetteExtras,代碼行數:3,代碼來源:loader.php

示例9: __isset

 /**
  * Is property defined?
  *
  * @param  string  property name
  * @return bool
  */
 public function __isset($name)
 {
     return ObjectMixin::has($this, $name) ? TRUE : (isset($this->_data[$name]) ? TRUE : array_key_exists($name, $this->_associations));
 }
開發者ID:matak,項目名稱:dbrecord,代碼行數:10,代碼來源:Entity.php

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