Ubiquity  2.0.3
php rapid development framework
YumlModelsCreator.php
Go to the documentation of this file.
1 <?php
3 
5 
6 
11  private $yumlParser;
12 
13  protected function init($config){
14  parent::init($config);
15  }
16 
17  public function initYuml($yumlString) {
18  $this->yumlParser=new YumlParser($yumlString);
19  }
20 
21 
22  protected function getTablesName(){
23  return $this->yumlParser->getTableNames();
24  }
25 
26  protected function getFieldsInfos($tableName) {
27  $fieldsInfos=array();
28  $fields = $this->yumlParser->getFields($tableName);
29  foreach ($fields as $field) {
30  $fieldsInfos[$field['name']] = ["Type"=>$field['type'],"Nullable"=>(isset($field["null"]) && $field["null"])];
31  }
32  return $fieldsInfos;
33  }
34 
35  protected function getPrimaryKeys($tableName){
36  return $this->yumlParser->getPrimaryKeys($tableName);
37  }
38 
39  protected function getForeignKeys($tableName,$pkName){
40  return $this->yumlParser->getForeignKeys($tableName);
41  }
42 }