Created
September 2, 2013 14:36
-
-
Save bakura10/6413545 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// In the InputCollection class, I have this. | |
// Basically, the issue is that when user called "validate", it should returns a "ValidationResult" object. However, | |
// this method needs to recursively calls each children input collection. BUT I don't want the children input filter to | |
// return a validation result, instead I want them return a simple array of error messages, that will be aggregated by | |
// the top input collection. | |
// | |
// I've thought about having validate(array $data, $context = null, $buildValidationResult = false); | |
// But it's ugly | |
// I think it'd be better to split this method into two, with a protected method that return error messages. | |
// Idea about naming? | |
/** | |
* {@inheritDoc} | |
*/ | |
public function validate(array $data, $context = null) | |
{ | |
$iterator = $this->getValidationGroupFilter(); | |
$iteratorIterator = new IteratorIterator($iterator); | |
foreach ($iteratorIterator as $inputOrInputCollection) { | |
if ($inputOrInputCollection instanceof InputInterface) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment