Ubiquity  2.0.3
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 
29  public function parse() {
30  $yumlResult = [ ];
31  $config = Startup::getConfig ();
32  $files = CacheManager::getModelsFiles ( $config, true );
33  if (\sizeof ( $files ) !== 0) {
34  foreach ( $files as $file ) {
35  $completeName = ClassUtils::getClassFullNameFromFile ( $file );
36  $yumlR = new ClassToYuml ( $completeName, $this->displayProperties, false, $this->displayMethods, $this->displayMethodsParams, $this->displayPropertiesTypes, false );
37  $yumlResult [] = $yumlR;
38  }
39  if ($this->displayAssociations) {
40  $count = \sizeof ( $files );
41  for($i = 0; $i < $count; $i ++) {
42  $result = $yumlResult [$i]->oneToManyTostring ();
43  if (UString::isNotNull ( $result ))
44  $yumlResult [] = $result;
45  }
46  }
47  }
48  return $yumlResult;
49  }
50 
51  public function __toString() {
52  return \implode ( Yuml::$groupeSeparator, $this->parse () );
53  }
54 }
static $groupeSeparator
Definition: Yuml.php:11
__construct($displayProperties=true, $displayAssociations=true, $displayMethods=false, $displayMethodsParams=false, $displayPropertiesTypes=false)
static getModelsFiles(&$config, $silent=false)
static getClassFullNameFromFile($filePathName, $backSlash=false)
get the full name (name \ namespace) of a class from its file path result example: (string) "I\Am\The...
Definition: ClassUtils.php:17