Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
YumlModelsCreator.php
Go to the documentation of this file.
1<?php
2
4
6
22 private $yumlParser;
23
24 protected function init($config, $offset = 'default') {
25 parent::init ( $config, $offset );
26 }
27
28 public function initYuml($yumlString) {
29 $this->yumlParser = new YumlParser ( $yumlString );
30 }
31
32 protected function getTablesName() {
33 return $this->yumlParser->getTableNames ();
34 }
35
36 protected function getFieldsInfos($tableName) {
37 $fieldsInfos = array ();
38 $fields = $this->yumlParser->getFields ( $tableName );
39 foreach ( $fields as $field ) {
40 $fieldsInfos [$field ['name']] = [ "Type" => $field ['type'],"Nullable" => (isset ( $field ["null"] ) && $field ["null"]) ];
41 }
42 return $fieldsInfos;
43 }
44
45 protected function getPrimaryKeys($tableName) {
46 return $this->yumlParser->getPrimaryKeys ( $tableName );
47 }
48
49 protected function getForeignKeys($tableName, $pkName,$dbName=null) {
50 return $this->yumlParser->getForeignKeys ( $tableName );
51 }
52}
getForeignKeys($tableName, $pkName, $dbName=null)