constraintSql() публичный Метод

Note integer primary keys will return ''. This is intentional as Sqlite requires that integer primary keys be defined in the column definition.
public constraintSql ( Table $table, $name )
$table Table
Пример #1
0
 /**
  * Test the constraintSql method.
  *
  * @dataProvider constraintSqlProvider
  */
 public function testConstraintSql($name, $data, $expected)
 {
     $driver = $this->_getMockedDriver();
     $schema = new SqliteSchema($driver);
     $table = (new Table('articles'))->addColumn('title', ['type' => 'string', 'length' => 255])->addColumn('author_id', ['type' => 'integer'])->addConstraint($name, $data);
     $this->assertEquals($expected, $schema->constraintSql($table, $name));
 }