File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ parameters:
5
5
- Crud\Event\Subject
6
6
ignoreErrors :
7
7
# ORM
8
+ - '#Call to an undefined method Cake\\Datasource\\EntityInterface::getVisible (). #'
8
9
9
10
# Crud properties
10
11
- ' #Access to an undefined property object::\$created #'
Original file line number Diff line number Diff line change 8
8
use Cake \Event \Event ;
9
9
use Cake \Http \Exception \BadRequestException ;
10
10
use Cake \ORM \Association ;
11
+ use Cake \ORM \Query ;
11
12
use Cake \ORM \ResultSet ;
12
13
use Cake \ORM \Table ;
13
14
use Cake \ORM \TableRegistry ;
14
- use Cake \ORM \Query ;
15
15
use Cake \Utility \Hash ;
16
16
use Cake \Utility \Inflector ;
17
17
use CrudJsonApi \Listener \JsonApi \DocumentValidator ;
Original file line number Diff line number Diff line change @@ -106,7 +106,10 @@ protected function getRepository($entity = null): Table
106
106
protected function entityToShallowArray (EntityInterface $ entity )
107
107
{
108
108
$ result = [];
109
- foreach ($ entity ->visibleProperties () as $ property ) {
109
+ $ properties = method_exists ($ entity , 'getVisible ' )
110
+ ? $ entity ->getVisible ()
111
+ : $ entity ->visibleProperties ();
112
+ foreach ($ properties as $ property ) {
110
113
$ value = $ entity ->get ($ property );
111
114
if (is_array ($ value )) {
112
115
$ result [$ property ] = [];
You can’t perform that action at this time.
0 commit comments