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; }