55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace RprtCli\Utils\TimeTrackingServices;
|
|
|
|
use Attribute;
|
|
|
|
/**
|
|
* Define entities and their properties.
|
|
*
|
|
* This should actually be the attribute extension that defines entity attributes.
|
|
*/
|
|
#[Attribute]
|
|
class EntityDefinition {
|
|
|
|
public function __construct(
|
|
private string $id,
|
|
private string $provider,
|
|
private string $name,
|
|
private array $fields,
|
|
private array $filters
|
|
) { }
|
|
|
|
public function getId() {
|
|
return $this->id;
|
|
}
|
|
|
|
public function getProvider() {
|
|
return $this->provider;
|
|
}
|
|
|
|
public function getName() {
|
|
return $this->name;
|
|
}
|
|
|
|
public function getFields() {
|
|
return $this->fields;
|
|
}
|
|
|
|
public function getFilters() {
|
|
return $this->filters;
|
|
}
|
|
|
|
public function getDefinition() {
|
|
return [
|
|
'id' => $this->id,
|
|
'provider' => $this->provider,
|
|
'name' => $this->name,
|
|
'fields' => $this->fields,
|
|
'filters' => $this->filters,
|
|
];
|
|
}
|
|
}
|