In a Doctrine Record object, I can add the following method to validate data:
protected function validate()
{
if (empty($this->first_name) && empty($this->last_name) && empty($this->company)) {
$this->getErrorStack()->add('company', 'You must fill in at least one of the following: First Name, Last Name, Company');
}
}
How do I add similar code to an attached Template object?