unify access to custom fields (#3106)

This commit is contained in:
Kevin Papst
2022-01-28 00:04:58 +01:00
committed by GitHub
parent 7a6fab8624
commit 4cb0ac37a6
16 changed files with 132 additions and 9 deletions

View File

@@ -719,6 +719,20 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
return null;
}
/**
* @param string $name
* @return bool|int|string|null
*/
public function getMetaFieldValue(string $name)
{
$field = $this->getMetaField($name);
if ($field === null) {
return null;
}
return $field->getValue();
}
public function setMetaField(MetaTableTypeInterface $meta): EntityWithMetaFields
{
if (null === ($current = $this->getMetaField($meta->getName()))) {