/** * * @param IXP_Form_Contact $form The form object * @param \Entities\Contact $object The Doctrine2 entity (being edited or blank for add) * @param bool $isEdit True of we are editing an object, false otherwise * @return void */ protected function addPostValidate($form, $object, $isEdit) { $object->setCustomer($this->getD2EM()->getRepository('\\Entities\\Customer')->find($form->getElement('custid')->getValue())); $object->setCabinet($this->getD2EM()->getRepository('\\Entities\\Cabinet')->find($form->getElement('cabinetid')->getValue())); return true; }