本文整理汇总了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];
}
}
示例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]);
}
示例3: __isset
/**
* Is property defined?
* @param string property name
* @return bool
*/
public function __isset($key)
{
return isset($this->data[$key]) || parent::__isset($key);
}
示例4: __unset
public function __unset($name)
{
if (parent::__isset($name)) {
parent::__unset($name);
} else {
unset($this->data->{$name});
}
}
示例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;
}
示例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);
}
}
示例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);
}
}