Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.

Attributable::relationsToArray() doesn't return entity attributes #166

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Traits/Attributable.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public function relationsToArray()
$relations = array_keys($this->getEntityAttributeRelations());

foreach ($relations as $relation) {
if (array_key_exists($relation, $attributes)) {
$eavAttributes[$relation] = $this->getAttribute($relation) instanceof BaseCollection
? $this->getAttribute($relation)->toArray() : $this->getAttribute($relation);
$eavAttributes[$relation] = $this->getAttribute($relation) instanceof BaseCollection
? $this->getAttribute($relation)->toArray() : $this->getAttribute($relation);

if (array_key_exists($relation, $attributes)) {
// By unsetting the relation from the attributes array we will make
// sure we do not provide a duplicity when adding the namespace.
// Otherwise it would keep the relation as a key in the root.
Expand Down