本文整理汇总了PHP中Doctrine\DBAL\Schema\Table::isQuoted方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::isQuoted方法的具体用法?PHP Table::isQuoted怎么用?PHP Table::isQuoted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\DBAL\Schema\Table
的用法示例。
在下文中一共展示了Table::isQuoted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testQuotedTableNames
public function testQuotedTableNames()
{
$table = new Table('"test"');
$table->addColumn('"id"', 'integer', array('autoincrement' => true));
// assert tabel
$this->assertTrue($table->isQuoted());
$this->assertEquals('test', $table->getName());
$this->assertEquals('"test"', $table->getQuotedName($this->_platform));
$sql = $this->_platform->getCreateTableSQL($table);
$this->assertEquals('CREATE TABLE "test" ("id" NUMBER(10) NOT NULL)', $sql[0]);
$this->assertEquals('CREATE SEQUENCE "test_SEQ" START WITH 1 MINVALUE 1 INCREMENT BY 1', $sql[2]);
$createTriggerStatement = <<<EOD
CREATE TRIGGER "test_AI_PK"
BEFORE INSERT
ON "test"
FOR EACH ROW
DECLARE
last_Sequence NUMBER;
last_InsertID NUMBER;
BEGIN
SELECT "test_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
IF (:NEW."id" IS NULL OR :NEW."id" = 0) THEN
SELECT "test_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
ELSE
SELECT NVL(Last_Number, 0) INTO last_Sequence
FROM User_Sequences
WHERE Sequence_Name = 'test_SEQ';
SELECT :NEW."id" INTO last_InsertID FROM DUAL;
WHILE (last_InsertID > last_Sequence) LOOP
SELECT "test_SEQ".NEXTVAL INTO last_Sequence FROM DUAL;
END LOOP;
END IF;
END;
EOD;
$this->assertEquals($createTriggerStatement, $sql[3]);
}