作者:vbuilde
项目:framewor
/**
* 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}().");
}
作者:fabi
项目:databas
public function __unset($key)
{
$column = $this->formatColumnName($key);
if (parent::__isset($column) || !ObjectMixin::has($this, $key)) {
parent::__unset($column);
} else {
ObjectMixin::remove($this, $key);
}
}
作者:natri
项目:gridit
/**
* @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;
}
作者:TheTypoMaste
项目:SPHERE-Framewor
public function __call($name, $args)
{
return Nette\ObjectMixin::callProperty($this, $name, $args);
}
作者:genextweb
项目:dropbox-sampl
/**
* Access to undeclared property.
* @param string property name
* @return void
* @throws Nette\MemberAccessException
*/
public function __unset($name)
{
Nette\ObjectMixin::remove($this, $name);
}
作者:JPaloune
项目:IconStor
public function __isset($name)
{
return ObjectMixin::has($this, $name);
}
作者:peterzador
项目:mov
/**
* @param $method
* @param $args
*/
public function __call($method, $args)
{
ObjectMixin::call($this, $method, $args);
}
作者:JanTvrdi
项目:NetteExtra
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
作者:mata
项目:dbrecor
/**
* 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));
}
作者:jsmitk
项目:ExtensionObject
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);
}