<?php

namespace App\Entity\Link;

use App\Entity\Link;
use App\Entity\Traits\TimestampableTrait;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity()
 * @ORM\Table("link_check")
 */
class Check
{
    use TimestampableTrait;

    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Link", inversedBy="checks")
     * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
     */
    private $link;

    /**
     * @ORM\Column(type="integer")
     */
    private $statusCode;

    /**
     * @ORM\Column(type="float")
     */
    private $responseTime;

    /**
     * @ORM\Column(type="boolean")
     */
    private $anchorHref;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $anchorText;

    /**
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $relNoFollow;

    /**
     * @ORM\Column(type="array", nullable=true)
     */
    private $output;

    /**
     * @ORM\Column(type="integer")
     */
    private $pageAuthority;

    /**
     * @ORM\Column(type="boolean")
     */
    private $positive;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getLink(): ?Link
    {
        return $this->link;
    }

    public function setLink(?Link $link): self
    {
        $this->link = $link;

        return $this;
    }

    public function getStatusCode(): ?int
    {
        return $this->statusCode;
    }

    public function setStatusCode(int $statusCode): self
    {
        $this->statusCode = $statusCode;

        return $this;
    }

    public function getResponseTime(): ?float
    {
        return $this->responseTime;
    }

    public function setResponseTime(float $responseTime): self
    {
        $this->responseTime = $responseTime;

        return $this;
    }

    public function getAnchorHref(): ?bool
    {
        return $this->anchorHref;
    }

    public function setAnchorHref(bool $anchorHref): self
    {
        $this->anchorHref = $anchorHref;

        return $this;
    }

    public function getAnchorText(): ?string
    {
        return $this->anchorText;
    }

    public function setAnchorText(?string $anchorText): self
    {
        $this->anchorText = $anchorText;

        return $this;
    }

    public function getRelNoFollow(): ?bool
    {
        return $this->relNoFollow;
    }

    public function setRelNoFollow(?bool $relNoFollow): self
    {
        $this->relNoFollow = $relNoFollow;

        return $this;
    }

    public function getOutput(): ?array
    {
        return $this->output;
    }

    public function setOutput(?array $output): self
    {
        $this->output = $output;

        return $this;
    }

    public function getPageAuthority(): ?int
    {
        return $this->pageAuthority;
    }

    public function setPageAuthority(int $pageAuthority): self
    {
        $this->pageAuthority = $pageAuthority;

        return $this;
    }

    public function isPositive(): ?bool
    {
        return $this->positive;
    }

    public function setPositive(bool $positive): self
    {
        $this->positive = $positive;

        return $this;
    }
}
