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