Last active
July 11, 2018 19:17
-
-
Save Pictor13/6bbdda8d43df8cbb0db45f4a60b5c6ab to your computer and use it in GitHub Desktop.
Override of AgaviValidationManager->getErrorNames() [that probably was forgotten to be implemented... ... anyway was deprecated]. Useful for retrieving the errors by the name that was used with 'throwError()' in the Validator or that is used for translations in the 'validate.xml'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Retrieve an array of error names. | |
* | |
* @return array An indexed array of error names. | |
* | |
* @author Igor Pellegrini <[email protected]> | |
* @author Sean Kerr <[email protected]> | |
* @author Dominik del Bondio <[email protected]> | |
* @since 0.9.0 | |
* | |
* @deprecated 1.0.0 | |
*/ | |
public function getErrorNames($minSeverity = null) | |
{ | |
$errors = array(); | |
foreach($this->getIncidents($minSeverity) as $incident) { | |
foreach ($incident->getErrors() as $error) { | |
$errors[] = $error->getName(); | |
} | |
} | |
return array_values(array_unique($errors)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment