<?php

namespace Entity;

use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
#[ORM\Table(name: 'kampagnen')]
#[ORM\HasLifecycleCallbacks]
class Kampagne
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column(type: 'integer')]
    private ?int $id = null;

    #[ORM\Column(type: 'boolean')]
    private bool $is_fb = false;

    #[ORM\Column(type: 'boolean')]
    private bool $is_tr = false;

    #[ORM\Column(type: 'boolean')]
    private bool $is_mail = false;

    #[ORM\Column(type: 'string', length: 255)]
    private string $dest_url;

    #[ORM\Column(type: 'string', length: 100, nullable: true)]
    private ?string $kid = null;

    #[ORM\Column(type: 'text', nullable: true)]
    private ?string $mailtext = null;

    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    private ?string $img = null;

    #[ORM\Column(type: 'string', length: 255, nullable: true)]
    private ?string $linktext = null;

    #[ORM\Column(type: 'smallint')]
    private int $ma = 0;

    #[ORM\Column(type: 'smallint')]
    private int $reload = 0;

    #[ORM\Column(type: 'float', nullable: true)]
    private ?float $verguetung = null;

    #[ORM\Column(type: 'integer', nullable: true)]
    private ?int $uebrig = null;

    #[ORM\ManyToOne(targetEntity: User::class)]
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
    private ?User $user = null;

    #[ORM\Column(type: 'datetime')]
    private \DateTimeInterface $dateCreated;

    #[ORM\Column(type: 'datetime')]
    private \DateTimeInterface $dateModified;

    #[ORM\PrePersist]
    public function setDateCreatedValue(): void
    {
        $this->dateCreated = new \DateTime();
        $this->dateModified = new \DateTime();
    }

    #[ORM\PreUpdate]
    public function setDateModifiedValue(): void
    {
        $this->dateModified = new \DateTime();
    }

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

    public function getIsFb(): bool
    {
        return $this->is_fb;
    }

    public function setIsFb(bool $is_fb): self
    {
        $this->is_fb = $is_fb;
        return $this;
    }

    public function getIsTr(): bool
    {
        return $this->is_tr;
    }

    public function setIsTr(bool $is_tr): self
    {
        $this->is_tr = $is_tr;
        return $this;
    }

    public function getIsMail(): bool
    {
        return $this->is_mail;
    }

    public function setIsMail(bool $is_mail): self
    {
        $this->is_mail = $is_mail;
        return $this;
    }

    public function getDestUrl(): string
    {
        return $this->dest_url;
    }

    public function setDestUrl(string $dest_url): self
    {
        $this->dest_url = $dest_url;
        return $this;
    }

    public function getKid(): ?string
    {
        return $this->kid;
    }

    public function setKid(?string $kid): self
    {
        $this->kid = $kid;
        return $this;
    }

    public function getMailtext(): ?string
    {
        return $this->mailtext;
    }

    public function setMailtext(?string $mailtext): self
    {
        $this->mailtext = $mailtext;
        return $this;
    }

    public function getImg(): ?string
    {
        return $this->img;
    }

    public function setImg(?string $img): self
    {
        $this->img = $img;
        return $this;
    }

    public function getLinktext(): ?string
    {
        return $this->linktext;
    }

    public function setLinktext(?string $linktext): self
    {
        $this->linktext = $linktext;
        return $this;
    }

    public function getMa(): int
    {
        return $this->ma;
    }

    public function setMa(int $ma): self
    {
        $this->ma = $ma;
        return $this;
    }

    public function getReload(): int
    {
        return $this->reload;
    }

    public function setReload(int $reload): self
    {
        $this->reload = $reload;
        return $this;
    }

    public function getVerguetung(): ?float
    {
        return $this->verguetung;
    }

    public function setVerguetung(?float $verguetung): self
    {
        $this->verguetung = $verguetung;
        return $this;
    }

    public function getUebrig(): ?int
    {
        return $this->uebrig;
    }

    public function setUebrig(?int $uebrig): self
    {
        $this->uebrig = $uebrig;
        return $this;
    }

    public function getDateCreated(): \DateTimeInterface
    {
        return $this->dateCreated;
    }

    public function getDateModified(): \DateTimeInterface
    {
        return $this->dateModified;
    }

    public function getUser(): ?User
    {
        return $this->user;
    }

    public function setUser(?User $user): self
    {
        $this->user = $user;
        return $this;
    }
}
