本文整理匯總了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]);
}