Skip to content

Commit

Permalink
see cl 1.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Patzer committed Mar 13, 2020
1 parent 21f40f3 commit a34cae6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.14.1] - 2020-03-13
- fixed load_callback to support callables

## [1.14.0] - 2020-02-24

- enhanced events
Expand Down
8 changes: 6 additions & 2 deletions src/Item/DefaultItem.php
Expand Up @@ -193,8 +193,12 @@ public function __set(string $name, $value)
foreach ($dca['fields'][$name]['load_callback'] as $callback) {
$this->dc->field = $name;

$instance = System::importStatic($callback[0]);
$value = $instance->{$callback[1]}($value, $this->dc);
if (\is_array($callback)) {
$instance = System::importStatic($callback[0]);
$value = $instance->{$callback[1]}($value, $this->dc);
} elseif (\is_callable($callback)) {
$value = $callback($value, $this->dc);
}
}
}

Expand Down

0 comments on commit a34cae6

Please sign in to comment.