本文整理匯總了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;
}