src/forms/EmployeeForm.php
public function validate()
    {
        $contacts = $this->getContactsCollection();
        if (!$contacts->validate()) {
            return $contacts->getFirstError();
        }

        if ($this->getContract() !== null) {
            if (!$this->getContract()->validate()) {
                return reset($this->getContract()->getFirstErrors());
            }
        }

        return true;
    }
public function validate()
    {
        $contacts = $this->getContactsCollection();
        if (!$contacts->validate()) {
            return $contacts->getFirstError();
        }

        if ($this->getContract() !== null) {
            if (!$this->getContract()->validate()) {
                return reset($this->getContract()->getFirstErrors());
            }
        }

        return true;
    }
public function validate ( ) { $ contacts = $ this -> getContactsCollection ( ) ; if ( ! $ contacts -> validate ( ) ) { return $ contacts -> getFirstError ( ) ; } if ( $ this -> getContract ( ) !== null ) { if ( ! $ this -> getContract ( ) -> validate ( ) ) { return reset ( $ this -> getContract ( ) -> getFirstErrors ( ) ) ; } } return true ; }
Validates all models of the form.

@return true|string
Validates all models of the form .