Skip to content

Commit

Permalink
Merge 952524d into 6707217
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota committed Sep 4, 2020
2 parents 6707217 + 952524d commit 51b220c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Schema/JsonApi/DynamicEntitySchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Cake\Core\App;
use Cake\Datasource\EntityInterface;
use Cake\ORM\Association;
use Cake\ORM\Locator\LocatorAwareTrait;
use Cake\ORM\Table;
use Cake\Routing\Exception\MissingRouteException;
use Cake\Routing\Router;
Expand All @@ -27,6 +28,7 @@
class DynamicEntitySchema extends BaseSchema
{
use InflectTrait;
use LocatorAwareTrait;

/**
* Holds the instance of Cake\View\View
Expand Down Expand Up @@ -106,7 +108,7 @@ protected function getRepository($entity = null): Table

$repositoryName = $entity->getSource();

return $this->view->getConfig('repositories')[$repositoryName];
return $this->getTableLocator()->get($repositoryName);
}

/**
Expand Down Expand Up @@ -221,8 +223,8 @@ public function getRelationships($entity, ContextInterface $context): iterable
if (empty($entity->$inflectedProperty)) {
$entity->$inflectedProperty = $entity->$property;
unset($entity->$property);
$property = $inflectedProperty;
}
$property = $inflectedProperty;

$hasSelfLink = false;
try {
Expand Down

0 comments on commit 51b220c

Please sign in to comment.