Ubiquity  2.0.0
php rapid development framework
ClassesToYuml.php
Go to the documentation of this file.
1 <?php
2 
4 
9 
13  private $displayMethods;
16 
18  $this->displayProperties=$displayProperties;
19  $this->displayAssociations=$displayAssociations;
20  $this->displayMethods=$displayMethods;
21  $this->displayMethodsParams=$displayMethodsParams;
22  $this->displayPropertiesTypes=$displayPropertiesTypes;
23  }
24 
28  public function parse(){
29  $yumlResult=[];
30  $config=Startup::getConfig();
31  $files=CacheManager::getModelsFiles($config,true);
32  if(\sizeof($files)!==0){
33  foreach ($files as $file){
34  $completeName=ClassUtils::getClassFullNameFromFile($file);
35  $yumlR=new ClassToYuml($completeName,$this->displayProperties,false,$this->displayMethods,$this->displayMethodsParams,$this->displayPropertiesTypes,false);
36  $yumlResult[]=$yumlR;
37  }
38  if($this->displayAssociations){
39  $count=\sizeof($files);
40  for($i=0;$i<$count;$i++){
41  $result=$yumlResult[$i]->oneToManyTostring();
42  if(UString::isNotNull($result))
43  $yumlResult[]=$result;
44  }
45  }
46  }
47  return $yumlResult;
48  }
49 
50  public function __toString(){
51  return \implode(Yuml::$groupeSeparator,$this->parse());
52  }
53 }
static $groupeSeparator
Definition: Yuml.php:11
static getClassFullNameFromFile($filePathName)
get the full name (name \ namespace) of a class from its file path result example: (string) "I\Am\The...
Definition: ClassUtils.php:15
__construct($displayProperties=true, $displayAssociations=true, $displayMethods=false, $displayMethodsParams=false, $displayPropertiesTypes=false)
static getModelsFiles(&$config, $silent=false)