本文整理汇总了PHP中Operator::operate方法的典型用法代码示例。如果您正苦于以下问题:PHP Operator::operate方法的具体用法?PHP Operator::operate怎么用?PHP Operator::operate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operator
的用法示例。
在下文中一共展示了Operator::operate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runEvent
protected function runEvent($place, $type, $values = array())
{
// Make sure that the content type has this even before
// we try and execute it
if ($this->hasEvent($place, $type)) {
// Go through all of the events for this section
foreach ($this->info->events->{$type}->{$place} as $event) {
// Create the operator for the event
$operator = new Operator($event->operator);
// And array for passing parameters to the operator
$params = array();
// Go through all of the parameter mappings for the event
// and map the parameters to the values passed in for creation
foreach ($event->inputParams as $name => $attribute) {
$params[$name] = $values[dash($attribute)];
}
// Send those parameter to the operator for executes
$results = $operator->operate($params);
// Remap the results for the operator to the values that go
// into creation
foreach ($event->outputParams as $name => $attribute) {
$values[dash($attribute)] = $results[$name];
}
}
}
return $values;
}