function check() { $errorObject = new CopixErrorObject(); if (strlen($this->worker_id) <= 0) { $errorObject->addError('worker_id', CopixI18N::get('copix:dao.errors.required', 'Worker id')); } if (strlen($this->branch_id) <= 0) { $errorObject->addError('branch_id', CopixI18N::get('copix:dao.errors.required', 'Branch id')); } return $errorObject->isError() ? $errorObject->asArray() : true; }
/** * Checks if we can send an email with the given configuration. */ public function check() { $error = new CopixErrorObject(); if ($this->to === null) { $error->addError('to', 'Aucune valeur donnée à destinataire.'); } if ($this->from === null) { $error->addError('from', 'Aucune valeur expéditeur'); } return $error; }