- Some bugfixes applied live
This commit is contained in:
1 parent
c2cccc0222
commit
acab934f6f
6 files changed
+7
-7
No files matched your search
+3
-3
@@ -157,7 +157,7 @@ trait EntityTrait {
|
||||
$annotation = $entityResolver->searchFieldAnnotation($key, [ Attribute\Property\Field::class, Field::class ]);
|
||||
|
||||
if ( isset($this->$key) ) {
|
||||
$dataset[$annotation->name ?? $key] = $rewriteValue?
|
||||
$dataset[$annotation->name ?? $key] = $rewriteValue ?
|
||||
static::repository()->adapter->adapter()->writableValue($this->$key)
|
||||
:
|
||||
$this->$key;
|
||||
@@ -195,9 +195,9 @@ trait EntityTrait {
|
||||
}
|
||||
|
||||
#[Ignore]
|
||||
public function toArray($includeRelations = false, array $filterFields = null) : array
|
||||
public function toArray($includeRelations = false, array $filterFields = null, bool $rewriteValue = true) : array
|
||||
{
|
||||
$dataset = $this->entityGetDataset($includeRelations, false, false);
|
||||
$dataset = $this->entityGetDataset($includeRelations, false, $rewriteValue);
|
||||
|
||||
return $filterFields ? array_intersect_key($dataset, array_flip($filterFields)) : $dataset;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user