get additional property

This commit is contained in:
2024-11-28 12:15:30 +03:00
parent 2133fae2cc
commit 44e61a2030
4 changed files with 109 additions and 94 deletions

View File

@ -26,17 +26,23 @@ $table->beforePrint(function () use ($content) {
});
$entityRelation = new \kernel\EntityRelation();
$additional = $entityRelation->getEntityAdditionalProperty("post", $content);
$additionals = $entityRelation->getEntityAdditionalProperty("post", $content);
foreach ($additionals as $key => $additional) {
$table->addRow($key, function () use ($additional) {
return $additional;
}, ['after' => 'user_id']);
}
$table->rows([
'created_at' => function ($data) {
if (!$data){
if (!$data) {
return null;
}
return (new DateTimeImmutable($data))->format("d-m-Y");
},
'updated_at' => function ($data) {
if (!$data){
if (!$data) {
return null;
}
return (new DateTimeImmutable($data))->format("d-m-Y");