* */
if ($_POST) {
    try {
        switch ($_POST['acao']) {
            case 'get':
                try {
                    /* TMP */
                    $out = DaoAssuntoDocumento::getAssunto($_POST['valor']);
                    $out['success'] = 'true';
                } catch (Exception $e) {
                    $out = array('success' => "false", 'error' => $e->getMessage());
                }
                break;
            case 'unique':
                $assunto = new AssuntoDocumento($_POST);
                $out = DaoAssuntoDocumento::uniqueAssunto($assunto)->toArray();
                break;
            case 'cadastrar':
                $assunto = new AssuntoDocumento($_POST);
                $out = DaoAssuntoDocumento::inserirAssunto($assunto)->toArray();
                break;
            case 'alterar':
                $assunto = new AssuntoDocumento($_POST);
                $out = DaoAssuntoDocumento::alterarAssunto($assunto)->toArray();
                break;
            case 'alterar-homologacao':
                try {
                    $id = $_POST['id'];
                    $status = $_POST['status'];
                    $out = DaoAssuntoDocumento::alterarHomologacao($id, $status)->toArray();
                } catch (Exception $e) {