本文整理汇总了PHP中Container::getSchema方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::getSchema方法的具体用法?PHP Container::getSchema怎么用?PHP Container::getSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::getSchema方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDifference
protected function getDifference()
{
$from = Container::getSchema();
$to = Container::getModifiedSchema();
$diffTool = getApplication()->getManager()->create("\\Migration\\Diff", array('from' => $from, 'to' => $to));
return $diffTool->getDiff();
}
示例2: testDifference
public function testDifference()
{
$from = Container::getSchema();
$to = Container::getModifiedSchema();
$diffTool = getApplication()->getManager()->create("\\Migration\\Diff", array('from' => $from, 'to' => $to));
$difference = $diffTool->getDiff();
$this->assertEquals(Container::getCorrectDifference(), $difference);
}
示例3: testRemoveModel
public function testRemoveModel()
{
$schema = Container::getSchema();
$moduleModel = $schema->getModel('module');
$this->assertNotNull($moduleModel);
$schema->removeModel('module');
$models = $schema->getModels();
$this->assertArrayNotHasKey('module', $models);
}
示例4: testGetSetPK
public function testGetSetPK()
{
$schema = Container::getSchema();
$person = $schema->getModel('person');
$idealPk = array('id_person', 'v_end');
$this->assertEquals($idealPk, $person->getPrimaryKey());
// Delete from property method
$vEnd = $person->getProperty('v_end');
$vEnd->setPrimary(false);
$this->assertArrayNotHasKey('v_end', $person->getPrimaryKey());
// Add from model method
$person->setPrimaryKey(array('id_person', 'login'));
$idealPk = array('id_person', 'login');
$this->assertEquals($idealPk, $person->getPrimaryKey());
}