<?php
declare(strict_types=1);
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity
* @ApiResource(iri = "http://schema.org/Thing", collectionOperations = {
"get" = {
"method" = "GET",
"normalization_context" = {
"groups" = {
"output"
}
},
"denormalization_context" = {
"groups" = {
"input"
}
}
},
"post" = {
"access_control" = "is_granted('ROLE_USER')",
"method" = "POST",
"normalization_context" = {
"groups" = {
"output"
}
},
"denormalization_context" = {
"groups" = {
"input"
}
}
}
}, itemOperations = {
"get" = {
"access_control" = "is_granted('IS_OWNER', object) or is_granted('ROLE_ADMIN') or is_granted('ROLE_SUPER_ADMIN')",
"method" = "GET",
"normalization_context" = {
"groups" = {
"output"
}
},
"denormalization_context" = {
"groups" = {
"input"
}
}
},
"put" = {
"access_control" = "is_granted('IS_OWNER', object) or is_granted('ROLE_ADMIN') or is_granted('ROLE_SUPER_ADMIN')",
"method" = "PUT",
"normalization_context" = {
"groups" = {
"output"
}
},
"denormalization_context" = {
"groups" = {
"input"
}
}
},
"delete" = {
"access_control" = "is_granted('IS_OWNER', object)",
"method" = "DELETE",
"normalization_context" = {
"groups" = {
"output"
}
},
"denormalization_context" = {
"groups" = {
"input"
}
}
}
}, attributes = {
"filters" = {
"address.search_filter",
},
"normalization_context" = {
"groups" = {
""
}
},
"denormalization_context" = {
"groups" = {
""
}
},
"pagination_items_per_page" = 10,
"pagination_client_items_per_page" = true
}) * The most generic type of item.
*
* @see http://schema.org/Thing Documentation on Schema.org
*/
class Address extends AbstractTimestamp
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
* @Groups({"output"})
*
* @var int|null
*/
protected $id;
/**
* @ORM\Column(type="string", length=180, nullable=true)
* @Groups({"output", "input"})
*
* @var string|null
*/
protected $nickname;
/**
* @ORM\Column(type="string", length=180, nullable=false)
* @Groups({"output", "input"})
*
* @var string|null
*/
protected $line1;
/**
* @ORM\Column(type="string", length=180, nullable=true)
* @Groups({"output", "input"})
*
* @var string|null
*/
protected $line2;
/**
* @ORM\Column(type="string", length=180, nullable=false)
* @Groups({"output", "input"})
*
* @var string|null
*/
protected $city;
/**
* @ORM\Column(type="string", length=10, nullable=false)
* @Groups({"output", "input"})
*
* @var string|null
*/
protected $zip;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"output", "input"})
*
* @var bool|null
*/
protected $addressBook;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Lookup")
* @ORM\JoinColumn(referencedColumnName="id")
* @Groups({"output", "input"})
*
* @var Lookup|null
*/
protected $state;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Lookup")
* @ORM\JoinColumn(referencedColumnName="id")
* @Groups({"output", "input"})
*
* @var Lookup|null
*/
protected $county;
public function getId(): ?int
{
return $this->id;
}
public function setNickname(?string $nickname): self
{
$this->nickname = $nickname;
return $this;
}
public function getNickname(): ?string
{
return $this->nickname;
}
public function setLine1(?string $line1): self
{
$this->line1 = $line1;
return $this;
}
public function getLine1(): ?string
{
return $this->line1;
}
public function setLine2(?string $line2): self
{
$this->line2 = $line2;
return $this;
}
public function getLine2(): ?string
{
return $this->line2;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setZip(?string $zip): self
{
$this->zip = $zip;
return $this;
}
public function getZip(): ?string
{
return $this->zip;
}
public function setAddressBook(?bool $addressBook): self
{
$this->addressBook = $addressBook;
return $this;
}
public function getAddressBook(): ?bool
{
return $this->addressBook;
}
public function setState(?Lookup $state): self
{
$this->state = $state;
return $this;
}
public function getState(): ?Lookup
{
return $this->state;
}
public function setCounty(?Lookup $county): self
{
$this->county = $county;
return $this;
}
public function getCounty(): ?Lookup
{
return $this->county;
}
}