当前位置: 首页>>代码示例>>PHP>>正文


PHP Object::__isset方法代码示例

本文整理汇总了PHP中Nette\Object::__isset方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::__isset方法的具体用法?PHP Object::__isset怎么用?PHP Object::__isset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nette\Object的用法示例。


在下文中一共展示了Object::__isset方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 /**
  * 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

示例2: __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

示例3: __isset

 /**
  * Is property defined?
  * @param  string  property name
  * @return bool
  */
 public function __isset($key)
 {
     return isset($this->data[$key]) || parent::__isset($key);
 }
开发者ID:eduardobenito10,项目名称:jenkins-php-quickstart,代码行数:9,代码来源:Identity.php

示例4: __unset

 public function __unset($name)
 {
     if (parent::__isset($name)) {
         parent::__unset($name);
     } else {
         unset($this->data->{$name});
     }
 }
开发者ID:redwormik,项目名称:fakeorm,代码行数:8,代码来源:Entity.php

示例5: __isset

 /**
  * Magic isset to $this->data
  * @param string $name
  * @return bool
  */
 public function __isset($name)
 {
     return !parent::__isset($name) ? isset($this->data[$name]) : TRUE;
 }
开发者ID:lucien144,项目名称:Restful,代码行数:9,代码来源:Resource.php

示例6: array

 /**
  * Provides access to shortcuts of page elements defined using property-read
  * annotations (eg. `property-read Element $name strategy=value`).
  *
  * If there is a getter for the value (eg. method `getFoo()` for `$foo` property),
  * the getter is used instead.
  *
  * Definition of a shortcut may include the tag name and required attributes
  * values. These are checked then. Eg. `property-read Element $name
  * strategy=value, tagName, [attrib=value, another=value]`.
  *
  * Eventual comment may be separated by a space and a hash: `property-read
  * Element $name strategy=value # Now this is a comment.`
  *
  * @param string $name
  * @return mixed
  */
 public function &__get($name)
 {
     $shortcuts = $this->getShortcuts();
     if (!parent::__isset($name) && isset($shortcuts[$name])) {
         $this->checkState();
         $criteria = array('strategy' => $shortcuts[$name][0], 'selector' => $shortcuts[$name][1]);
         $expectedTagName = isset($shortcuts[$name][3]) ? $shortcuts[$name][3] : NULL;
         $expectedAttribs = isset($shortcuts[$name][4]) ? $shortcuts[$name][4] : NULL;
         if ($shortcuts[$name][2]) {
             $elements = $this->findElements($criteria['strategy'], $criteria['selector']);
             foreach ($elements as $index => $element) {
                 $shortcutDescription = get_class($this) . '::$' . $name . "[{$index}]";
                 $this->checkTagNameAndAttributes($element, $shortcutDescription, $expectedTagName, $expectedAttribs);
             }
             return $elements;
         } else {
             $element = $this->findElement($criteria['strategy'], $criteria['selector']);
             $shortcutDescription = get_class($this) . '::$' . $name;
             $this->checkTagNameAndAttributes($element, $shortcutDescription, $expectedTagName, $expectedAttribs);
             return $element;
         }
     } else {
         return parent::__get($name);
     }
 }
开发者ID:clevis,项目名称:se34,代码行数:42,代码来源:PageComponent.php

示例7: __isset

 /**
  * Is property defined?
  * Tries to use dynamic getter for protected properties (reflection fields).
  *
  * @param  string  property name
  * @return bool
  */
 public function __isset($name)
 {
     if (parent::__isset($name)) {
         return TRUE;
     } else {
         return $this->hasProtectedReflectionField($name);
     }
 }
开发者ID:romansklenar,项目名称:nette-activeentity,代码行数:15,代码来源:ActiveEntity.php


注:本文中的Nette\Object::__isset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。