Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
Added name and formalName to person
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Jan 8, 2020
1 parent 6e6a989 commit d621b9d
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion api/src/Entity/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ class Person
*/
private $id;


/**
* @var string The full name of a person consisting of given and fammily name
*
* @example John Do
*
* @Groups({"read"})
*/
private $name;

/**
* @var string The full name of a person consisting of fammily and given name
*
* @example Do, John
*
* @Groups({"read"})
*/
private $formalName;

/**
* @var string Given name of this person
*
Expand Down Expand Up @@ -148,7 +167,25 @@ public function getId()
{
return $this->id;
}


public function getName(): ?string
{
if($this->getAdditionalName()){
return $this->givenName.' '.$this->additionalName.' '.$this->familyNames;
}

return $this->givenName.' '.$this->familyNames;
}

public function getFormalName(): ?string
{
if($this->getAdditionalName()){
return $this->familyName.', '.$this->givenName.' '.$this->additionalName;
}

return $this->familyName.', '.$this->givenName;
}

public function getGivenName(): ?string
{
return $this->givenName;
Expand Down

0 comments on commit d621b9d

Please sign in to comment.