30 lines
560 B
PHP
30 lines
560 B
PHP
<?php
|
|
|
|
namespace KupShop\ComponentsBundle\Entity;
|
|
|
|
class ObjectInfo
|
|
{
|
|
public function __construct(
|
|
public string $type,
|
|
public int $id,
|
|
public string $name,
|
|
public ?array $placeholders = null,
|
|
) {
|
|
}
|
|
|
|
public function asArray(): array
|
|
{
|
|
$objInfo = [
|
|
'type' => $this->type,
|
|
'id' => $this->id,
|
|
'name' => $this->name,
|
|
];
|
|
|
|
if ($this->placeholders) {
|
|
$objInfo['placeholders'] = $this->placeholders;
|
|
}
|
|
|
|
return $objInfo;
|
|
}
|
|
}
|