Don't need to check for empty because Model::validator() returns an interator

This commit is contained in:
David Gallagher 2013-07-30 11:09:43 +10:00
parent 5937685817
commit bce0eb37b4

View file

@ -218,13 +218,11 @@ class FormHelper extends AppHelper {
if ($key === 'validates' && !isset($this->fieldset[$model]['validates'])) {
$validates = array();
if ($object->validator()->count() > 0) {
foreach ($object->validator() as $validateField => $validateProperties) {
if ($this->_isRequiredField($validateProperties)) {
$validates[$validateField] = true;
}
}
}
$this->fieldset[$model]['validates'] = $validates;
}