/** * For each defined content we check that the corresponding editor is also defined. */ protected function validate(\ICanBoogie\Errors $errors) { $contents = $this->request['contents']; $editors = $this->request['editors']; if ($contents) { foreach (array_keys($contents) as $name) { if (!array_key_exists($name, $editors)) { $errors['content'][] = $errors->format('The editor is missing for the content %name.', array('name' => $name)); } } } return parent::validate($errors); }