public function testSetDescription()
 {
     $table = new Table();
     $this->assertFalse($table->hasDescription());
     $table->setDescription('Some description');
     $this->assertTrue($table->hasDescription());
     $this->assertSame('Some description', $table->getDescription());
 }
Example #2
0
$table1->addForeignKeys([$fkAuthorPost, $fkCategoryPost]);
$table1->addBehavior($timestampableBehavior);
$table1->addBehavior($sluggableBehavior);
$table2 = new Table('blog_author');
$table2->setDescription('The list of authors');
$table2->setNamespace('Blog');
$table2->setPackage('Acme.Blog');
$table2->addColumns([$column21, $column22, $column23]);
$table2->addUnique($authorUsernameUnique);
$table3 = new Table('blog_category');
$table3->setDescription('The list of categories');
$table3->setNamespace('Blog');
$table3->setPackage('Acme.Blog');
$table3->addColumns([$column31, $column32]);
$table4 = new Table('blog_tag');
$table4->setDescription('The list of tags');
$table4->setNamespace('Blog');
$table4->setPackage('Acme.Blog');
$table4->addColumns([$column41, $column42]);
$table5 = new Table('blog_post_tag');
$table5->setNamespace('Blog');
$table5->setPackage('Acme.Blog');
$table5->setCrossRef();
$table5->addColumns([$column51, $column52]);
$table5->addForeignKeys([$fkPostTag, $fkTagPost]);
$table6 = new Table('cms_page');
$table6->setPhpName('Page');
$table6->setNamespace('Cms');
$table6->setBaseClass('Acme\\Model\\PublicationActiveRecord');
$table6->setPackage('Acme.Cms');
$table6->addColumns([$column61, $column62, $column63, $column64]);