本文整理匯總了PHP中Nette\Utils\ObjectMixin::call方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectMixin::call方法的具體用法?PHP ObjectMixin::call怎麽用?PHP ObjectMixin::call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Nette\Utils\ObjectMixin
的用法示例。
在下文中一共展示了ObjectMixin::call方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __call
/**
* Simple gate for Nette object events.
* @param string method name
* @param array arguments
* @return mixed
* @throws MemberAccessException
*/
public function __call($name, $args)
{
if ($name >= 'onA' && $name < 'on_') {
return ObjectMixin::call($this, $name, $args);
} else {
throw new MemberAccessException($name);
}
}
示例2: fireEvent
public function fireEvent($method, $args = [])
{
if (!method_exists($this, $method)) {
throw new InvalidArgumentException("Event '{$method}' does not exist.");
}
$this->eventCheck = FALSE;
call_user_func_array([$this, $method], $args);
if (!$this->eventCheck) {
throw new InvalidStateException("Event '{$method}' was not correctly propagate to overwritten methods.");
}
if (property_exists($this, $method)) {
ObjectMixin::call($this, $method, $args);
}
}
示例3: __call
/**
* Callbacks
* @param string $name
* @param array $args
* @return mixed
* @throws MemberAccessException
*/
public function __call($name, $args)
{
return ObjectMixin::call($this, $name, $args);
}
示例4: fireEvent
protected function fireEvent(IEntity $entity, $event)
{
if (!property_exists($this, $event)) {
throw new InvalidArgumentException("Event '{$event}' is not defined.");
}
$entity->fireEvent($event);
ObjectMixin::call($this, $event, [$entity]);
}
示例5: __call
/**
* @param string $name
* @param array $args
*
* @return mixed
*/
public function __call($name, $args)
{
if (method_exists('Nette\\Utils\\ObjectMixin', 'callProperty')) {
return ObjectMixin::callProperty($this, $name, $args);
} else {
return ObjectMixin::call($this, $name, $args);
}
}
示例6: __call
/**
* Call to undefined method.
*
* @param string $name
* @param array $args
*
* @throws \Nette\MemberAccessException
* @return mixed
*/
public function __call($name, $args)
{
if (strpos($name, 'findBy') === 0 || strpos($name, 'findOneBy') === 0) {
return parent::__call($name, $args);
}
return ObjectMixin::call($this, $name, $args);
}
示例7: __call
/**
* Call to undefined method.
* @param string method name
* @param array arguments
* @return mixed
* @throws MemberAccessException
*/
public function __call($name, $args)
{
return Nette\Utils\ObjectMixin::call($this, $name, $args);
}
示例8: __call
/**
* Call to undefined method.
* @param string method name
* @param array arguments
* @return mixed
* @throws MemberAccessException
*/
public function __call(string $name, array $args)
{
return ObjectMixin::call($this, $name, $args);
}