<?php/** * @license SILK SOFTWARE HOUSE SP Z O O */namespace App\Entity;use Doctrine\ORM\Mapping as ORM;/** * Cached response * * @ORM\Table(name="cached_responses") * @ORM\Entity(repositoryClass="App\Repository\CachedResponseRepository") */class CachedResponse{ /** * Auto-incremented id. * * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue */ private $id; /** * Idempotence hash. * * @var string * * @ORM\Column(name="request_id", type="text", options={"description": "Idempotence hash."}) */ private $idempotenceHash; /** * Response code. * * @var int * * @ORM\Column(name="response_code", type="integer") */ private $responseCode = 200; /** * Response. * * @var string * * @ORM\Column(name="response", type="text", nullable=false) */ private $response; /** * Route. * * @var string * * @ORM\Column(name="route", type="string", length=255, nullable=false) */ private $route; /** * Get auto-incremented id. * * @return int */ public function getId(): ?int { return $this->id; } /** * Get request string. * * @return string */ public function getIdempotenceHash(): string { return $this->idempotenceHash; } /** * Set request id. * * @param string $idempotenceHash * * @return CachedResponse */ public function setIdempotenceHash(string $idempotenceHash): CachedResponse { $this->idempotenceHash = $idempotenceHash; return $this; } /** * Get response code. * * @return int */ public function getResponseCode(): int { return $this->responseCode; } /** * Get new (not 201) response code. * * @return int */ public function getNot201ResponseCode(): int { return 201 === $this->responseCode ? 200 : $this->responseCode; } /** * Set response code. * * @param int $responseCode * * @return CachedResponse */ public function setResponseCode(int $responseCode): CachedResponse { $this->responseCode = $responseCode; return $this; } /** * Get response. * * @return string */ public function getResponse(): string { return $this->response; } /** * Set response. * * @param string $response * * @return CachedResponse */ public function setResponse(string $response): CachedResponse { $this->response = $response; return $this; } /** * Get route. * * @return string */ public function getRoute(): string { return $this->route; } /** * Set route. * * @param string $route * * @return CachedResponse */ public function setRoute(string $route): CachedResponse { $this->route = $route; return $this; }}