當前位置: 首頁>>代碼示例>>PHP>>正文


PHP xmldb_field::setNotnull方法代碼示例

本文整理匯總了PHP中xmldb_field::setNotnull方法的典型用法代碼示例。如果您正苦於以下問題:PHP xmldb_field::setNotnull方法的具體用法?PHP xmldb_field::setNotnull怎麽用?PHP xmldb_field::setNotnull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xmldb_field的用法示例。


在下文中一共展示了xmldb_field::setNotnull方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: xmldb_questionnaire_upgrade


//.........這裏部分代碼省略.........
                    if ($questionnaire->resp_eligible == 'teachers') {
                        assign_capability($capsubmit, CAP_ALLOW, $editteacherroleid, $context->id, true);
                        assign_capability($capsubmit, CAP_ALLOW, $teacherroleid, $context->id, true);
                        assign_capability($capview, CAP_PREVENT, $studentroleid, $context->id, true);
                        assign_capability($capsubmit, CAP_PREVENT, $studentroleid, $context->id, true);
                    }
                }
            }
            $rs->close();
        }
        // Questionnaire savepoint reached.
        upgrade_mod_savepoint(true, 2008031904, 'questionnaire');
    }
    if ($oldversion < 2008031905) {
        $table = new xmldb_table('questionnaire_survey');
        $field = new xmldb_field('changed');
        $dbman->drop_field($table, $field);
        // Questionnaire savepoint reached.
        upgrade_mod_savepoint(true, 2008031905, 'questionnaire');
    }
    if ($oldversion < 2008031906) {
        $table = new xmldb_table('questionnaire_response_rank');
        $field = new xmldb_field('rank');
        $field->set_attributes(XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null, null, '0', 'choice_id');
        $field->setUnsigned(false);
        $dbman->change_field_unsigned($table, $field);
        // Questionnaire savepoint reached.
        upgrade_mod_savepoint(true, 2008031906, 'questionnaire');
    }
    if ($oldversion < 2008060401) {
        $table = new xmldb_table('questionnaire_question');
        $field = new xmldb_field('name');
        $field->set_attributes(XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null, null, null, 'survey_id');
        $field->setNotnull(false);
        $dbman->change_field_notnull($table, $field);
        // Questionnaire savepoint reached.
        upgrade_mod_savepoint(true, 2008060401, 'questionnaire');
    }
    if ($oldversion < 2008070702) {
        $table = new xmldb_table('questionnaire_question_type');
        $field = new xmldb_field('response_table');
        $field->set_attributes(XMLDB_TYPE_CHAR, '32', null, XMLDB_NOTNULL, null, null, null, null, 'has_choices');
        $field->setNotnull(false);
        $dbman->change_field_notnull($table, $field);
        // Questionnaire savepoint reached.
        upgrade_mod_savepoint(true, 2008070702, 'questionnaire');
    }
    if ($oldversion < 2008070703) {
        $table = new xmldb_table('questionnaire_resp_multiple');
        $index = new xmldb_index('response_question');
        $index->set_attributes(XMLDB_INDEX_NOTUNIQUE, array('response_id', 'question_id', 'choice_id'));
        if (!$dbman->index_exists($table, $index)) {
            $dbman->add_index($table, $index);
        }
        // Questionnaire savepoint reached.
        upgrade_mod_savepoint(true, 2008070703, 'questionnaire');
    }
    if ($oldversion < 2008070704) {
        // CONTRIB-1542.
        $table = new xmldb_table('questionnaire_survey');
        $field = new xmldb_field('email');
        $field->set_attributes(XMLDB_TYPE_CHAR, '64', null, XMLDB_NOTNULL, null, null, null, null, 'title');
        $field->setLength('255');
        $dbman->change_field_precision($table, $field);
        // Questionnaire savepoint reached.
        upgrade_mod_savepoint(true, 2008070704, 'questionnaire');
開發者ID:OctaveBabel,項目名稱:moodle-itop,代碼行數:67,代碼來源:upgrade.php


注:本文中的xmldb_field::setNotnull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。