Skip to content

Commit

Permalink
Merge pull request #13 from viosys/bug/fix-collection-handling
Browse files Browse the repository at this point in the history
fix collection handling
  • Loading branch information
RaimundHagemann authored Jun 6, 2024
2 parents 700537b + d01ce5c commit ff80243
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Schema/NavigationProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class NavigationProperty
use HasSchema;

protected $name;
protected $isCollection = false;
protected $type;
protected $route;

Expand All @@ -41,6 +42,7 @@ public function __construct($property, Schema $schema)
$this->schema = $schema;
$this->name = $this->schema->getAliases()[$property['@attributes']['Name']] ?? $property['@attributes']['Name'];
$this->route = $property['@attributes']['Name'];
$this->isCollection = !!preg_match('/Collection\(.+\)/i', $property['@attributes']['Type']);
$this->type = Schema::getType($property['@attributes']['Type']);

if ($this->isCollection()) {
Expand All @@ -50,7 +52,7 @@ public function __construct($property, Schema $schema)

public function isCollection()
{
return !!preg_match('/Collection\(.+\)/i', $this->type);
return $this->isCollection;
}

public function getEntityType()
Expand Down

0 comments on commit ff80243

Please sign in to comment.