Skip to content

Instantly share code, notes, and snippets.

@marinsagovac
Created January 25, 2018 16:14
Show Gist options
  • Save marinsagovac/75718e0099b3e15628a11a1dfcb5f896 to your computer and use it in GitHub Desktop.
Save marinsagovac/75718e0099b3e15628a11a1dfcb5f896 to your computer and use it in GitHub Desktop.
API Platform / generated from Schema.org
<?php
declare(strict_types=1);
namespace AppBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* A person (alive, dead, undead, or fictional).
*
* @see http://schema.org/Person Documentation on Schema.org
*
* @ORM\Entity
* @ApiResource(iri="http://schema.org/Person")
*/
class Person
{
/**
* @var int|null
*
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var string|null Family name. In the U.S., the last name of an Person. This can be used along with givenName instead of the name property.
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/familyName")
*/
private $familyName;
/**
* @var string|null Given name. In the U.S., the first name of a Person. This can be used along with familyName instead of the name property.
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/givenName")
*/
private $givenName;
/**
* @var string|null an additional name for a Person, can be used for a middle name
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/additionalName")
*/
private $additionalName;
/**
* @var string|null Gender of the person. While http://schema.org/Male and http://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender.
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/gender")
*/
private $gender;
/**
* @var PostalAddress|null physical address of the item
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\PostalAddress")
* @ApiProperty(iri="http://schema.org/address")
*/
private $address;
/**
* @var \DateTimeInterface|null date of birth
*
* @ORM\Column(type="date", nullable=true)
* @ApiProperty(iri="http://schema.org/birthDate")
* @Assert\Date
*/
private $birthDate;
/**
* @var string|null the telephone number
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/telephone")
*/
private $telephone;
/**
* @var string|null email address
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/email")
* @Assert\Email
*/
private $email;
/**
* @var string|null URL of the item
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/url")
* @Assert\Url
*/
private $url;
/**
* @var string|null the job title of the person (for example, Financial Manager)
*
* @ORM\Column(type="text", nullable=true)
* @ApiProperty(iri="http://schema.org/jobTitle")
*/
private $jobTitle;
public function getId(): ?int
{
return $this->id;
}
public function setFamilyName(?string $familyName): void
{
$this->familyName = $familyName;
}
public function getFamilyName(): ?string
{
return $this->familyName;
}
public function setGivenName(?string $givenName): void
{
$this->givenName = $givenName;
}
public function getGivenName(): ?string
{
return $this->givenName;
}
public function setAdditionalName(?string $additionalName): void
{
$this->additionalName = $additionalName;
}
public function getAdditionalName(): ?string
{
return $this->additionalName;
}
public function setGender(?string $gender): void
{
$this->gender = $gender;
}
public function getGender(): ?string
{
return $this->gender;
}
public function setAddress(?PostalAddress $address): void
{
$this->address = $address;
}
public function getAddress(): ?PostalAddress
{
return $this->address;
}
public function setBirthDate(?\DateTimeInterface $birthDate): void
{
$this->birthDate = $birthDate;
}
public function getBirthDate(): ?\DateTimeInterface
{
return $this->birthDate;
}
public function setTelephone(?string $telephone): void
{
$this->telephone = $telephone;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setEmail(?string $email): void
{
$this->email = $email;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setUrl(?string $url): void
{
$this->url = $url;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setJobTitle(?string $jobTitle): void
{
$this->jobTitle = $jobTitle;
}
public function getJobTitle(): ?string
{
return $this->jobTitle;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment