public function getTipoDocumento() { $cpf_cnpj = Util::onlyNumbers($this->documento); if (strlen($cpf_cnpj) == 11) { return 'CPF'; } else { if (strlen($cpf_cnpj) == 14) { return 'CNPJ'; } } return 'Documento'; }