Skip to content

Commit

Permalink
Add typecast rendering; add inversion and order_by in php renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Nov 18, 2021
1 parent 6904789 commit 9ac5162
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/OutputSchemaRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(int $format = self::FORMAT_CONSOLE_COLOR)
// JTI support
if (isset($constants['PARENT'], $constants['PARENT_KEY'])) {
$this->addRenderer(...[
new PropertyRenderer($constants['PARENT'], 'CHILDREN'),
new PropertyRenderer($constants['PARENT'], 'Children'),
new KeysRenderer($constants['PARENT_KEY'], 'STI key', false),
]);
}
Expand All @@ -69,12 +69,15 @@ public function __construct(int $format = self::FORMAT_CONSOLE_COLOR)
]);
}

$this->addRenderer(...[
new ColumnsRenderer(),
$this->addRenderer(new ColumnsRenderer());
if (isset($constants['TYPECAST_HANDLER'])) {
$this->addRenderer(new PropertyRenderer($constants['TYPECAST_HANDLER'], 'Typecast'));
}
$this->addRenderer(
new RelationsRenderer(),
new CustomPropertiesRenderer(array_values($constants)),
new MacrosRenderer(),
]);
);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/PhpFileRenderer/Item/RelationBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@

class RelationBlock extends ArrayBlock
{
/**
* @see SchemaInterface
*/
private const RELATION_SCHEMA_KEYS = [
'MORPH_KEY',
'CASCADE',
'NULLABLE',
'OUTER_KEY',
'INNER_KEY',
'INVERSION',
'WHERE',
'ORDER_BY',
'THROUGH_INNER_KEY',
'THROUGH_OUTER_KEY',
'THROUGH_ENTITY',
Expand Down

0 comments on commit 9ac5162

Please sign in to comment.