person: add person ressource to person docgen normaliser

This commit is contained in:
nobohan
2022-03-17 19:07:11 +01:00
parent 5e0a693108
commit e7299bac4a
2 changed files with 28 additions and 1 deletions

View File

@@ -117,6 +117,27 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
return $this->person;
}
/**
* @Groups({"read"})
*/
public function getResourceKind(): string
{
if ($this->getPerson() instanceof Person) {
return 'person';
}
if ($this->getThirdParty() instanceof ThirdParty) {
return 'thirdparty';
}
if (null !== $this->getFreeText()) {
return 'freetext';
}
return 'none';
}
public function getPersonOwner(): ?Person
{
return $this->personOwner;