Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Created January 7, 2015 19:50
Show Gist options
  • Save lorenzo/c5acad6b34782691bfde to your computer and use it in GitHub Desktop.
Save lorenzo/c5acad6b34782691bfde to your computer and use it in GitHub Desktop.
public function buildRules(RulesChecker $rules) {
$rules->add(
function ($entity) {
$errors = $this->validator('special')->errors($entity->toArray(), $entity->isNew());
$entity->errors($errors);
return !$errors;
});
return $rules;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment