chg: [component:CRUD] Fixed typo

pull/93/head
Sami Mokaddem 2022-01-20 11:57:48 +01:00
parent a60ca95120
commit 86946719c7
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 2 additions and 4 deletions

View File

@ -79,8 +79,7 @@ class CRUDComponent extends Component
}
if (isset($options['afterFind'])) {
$function = $options['afterFind'];
if (is_callable($options['afterFind'])) {
$function = $options['afterFind'];
if (is_callable($function)) {
$data->each(function($value, $key) use ($function) {
return $function($value);
});
@ -100,8 +99,7 @@ class CRUDComponent extends Component
$data = $this->Controller->Paginator->paginate($query);
if (isset($options['afterFind'])) {
$function = $options['afterFind'];
if (is_callable($options['afterFind'])) {
$function = $options['afterFind'];
if (is_callable($function)) {
$data->each(function($value, $key) use ($function) {
return $function($value);
});