Skip to content

Commit

Permalink
Improved entity diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jul 27, 2016
1 parent e0c1725 commit 175aeb2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions misc/tools/model_helper.php
Expand Up @@ -76,14 +76,19 @@ protected function execute(InputInterface $input, OutputInterface $output) {
echo("\n== " . $group . " ==\n");

foreach($entities as $entity) {
echo(str_pad($entity->getName() . ":", 16));
$name = $entity->getName();
echo(str_pad($name . ":", 20));

$value = (isset($entity->$property)) ? $entity->$property : '';

if (in_array($property, $entity->required))
echo("required\n");
$required = "required";
elseif (in_array($property, $entity->optional))
echo("optional\n");
$required = "optional";
else
echo("not allowed\n");
$required = "not allowed";

printf("%s\t%s\n", $required, $value);
}

echo("\n");
Expand Down

0 comments on commit 175aeb2

Please sign in to comment.