/** * Getter * * @param string $name * @return mixed * @throws MemberAccessException */ public function &__get($name) { try { return $this->universalGetValue($name); } catch (\MemberAccessException $e) { return parent::__get($name); } }
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); }
/** * 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]; } }
public function &__get($name) { $service = $this->getService($name, false); if ($service) { return $service; } $object = parent::__get($name); return $object; }
/** * @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); }
/** * @param string $name * @return mixed * * @throws \Exception|\Nette\MemberAccessException */ public function &__get($name) { try { return parent::__get($name); } catch (MemberAccessException $e) { $data = $this->getData(); if (isset($data[$name])) { return $data[$name]; } throw $e; } }
/** * Returns user data value. * @param string property name * @return mixed */ public function &__get($key) { if (parent::__isset($key)) { return parent::__get($key); } else { return $this->data[$key]; } }
public function &__get($name) { if (parent::__isset($name)) { return parent::__get($name); } $value = $this->data->{$name}; if ($value instanceof ActiveRow) { $value = $this->repository->getReferenced($name, NULL, $value); } return $value; }
/** * Getter proměnných. * @param mixed $name * @return mixed */ public function &__get($name) { return parent::__get($name); }
/** * 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); } }
public function &__get($name) { if ($this->entity) { try { $value = $this->entity->{$name}; return $value; } catch (MemberAccessException $e) { } } return parent::__get($name); }
/** * Returns property value. Do not call directly. * Tries to use dynamic getter for protected properties (reflection fields) if getter is not defined. * * @param string property name * @return mixed property value * @throws MemberAccessException if the property is not defined. */ public function &__get($name) { try { $value = parent::__get($name); return $value; } catch (MemberAccessException $e) { if ($this->hasProtectedReflectionField($name)) { // intentionally not used __isset $value = $this->{$name}; return $value; } else { $class = get_called_class(); throw new MemberAccessException($e->getMessage() . " If you want to use dynamic getter for this property, make sure that property has visibility 'protected'."); } } }
/** * @param string $name * @return mixed */ public function &__get($name) { if ($this->isOption($name) && !property_exists($this, $name)) { return $this->options[$name]; } return parent::__get($name); }
public function &__get($name) { foreach ($this->getExtensions() as $extension) { /* @var $extension ExtensionObject */ if ($extension->getReflection()->hasProperty($name)) { $property = $extension->getReflection()->getProperty($name); if ($property->isPublic() && !$property->isStatic()) { return $extension->{$name}; } } if (ObjectMixin::has($extension, $name)) { return ObjectMixin::get($extension, $name); } } return parent::__get($name); }