本文整理汇总了PHP中Mapper::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP Mapper::generate方法的具体用法?PHP Mapper::generate怎么用?PHP Mapper::generate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper::generate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Mapper $mapper, array $namespaces, array $paths)
{
$this->mapper = $mapper;
$this->namespaces = $namespaces;
$this->paths = $paths;
$this->tables = $this->mapper->generate();
}
示例2: Model
try {
$newModel = new Model($outputDir, $tableToModel, $fields);
$newModel->generate();
// Debug
//die( $newModel->getOutput() );
// Write it
echo "Attempting to write model to file: {$newModel->getTargetFile()}\n";
$newModel->write();
echo "SUCCESS! Model written to: {$newModel->getTargetFile()}\n\n";
} catch (Exception $e) {
echo 'ERROR:' . $e->getMessage() . "\n";
}
// Make the Mapper
try {
$newMapper = new Mapper($outputDir, $tableToModel, $fields);
$newMapper->generate();
// Debug
//die( $newMapper->getOutput() );
// Write it
echo "Attempting to write mapper to file: {$newMapper->getTargetFile()}\n";
$newMapper->write();
echo "SUCCESS! Mapper written to: {$newMapper->getTargetFile()}\n\n";
} catch (Exception $e) {
echo 'ERROR:' . $e->getMessage() . "\n";
}
// Make the test cases
try {
$newTestCase = new TestCase($testDir, $tableToModel, $fields);
$newTestCase->generate();
// Debug
//die( $newTestCase->getOutput() );