本文整理汇总了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);
}