Skip to content

Commit 5468661

Browse files
authored
Merge branch 'master' into skip-attribute
2 parents 6f2710c + 70a8d7e commit 5468661

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
- Crud\Event\Subject
66
ignoreErrors:
77
# ORM
8+
- '#Call to an undefined method Cake\\Datasource\\EntityInterface::getVisible().#'
89

910
# Crud properties
1011
- '#Access to an undefined property object::\$created#'

src/Schema/JsonApi/DynamicEntitySchema.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ protected function getRepository($entity = null): Table
107107
protected function entityToShallowArray(EntityInterface $entity)
108108
{
109109
$result = [];
110-
foreach ($entity->visibleProperties() as $property) {
110+
$properties = method_exists($entity, 'getVisible')
111+
? $entity->getVisible()
112+
: $entity->visibleProperties();
113+
foreach ($properties as $property) {
111114
if ($property === '_joinData') {
112115
continue;
113116
}

0 commit comments

Comments
 (0)