<?php
namespace App\Entity;
use App\Repository\FriendTriweerRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Blameable\Traits\BlameableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: FriendTriweerRepository::class)]
class FriendTriweer
{
use BlameableEntity; //Hook blameable behavior. Updates createdBy, updatedBy fields
use TimestampableEntity; //Hook timestampable behavior. Updates createdAt, updatedAt fields
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "IDENTITY")]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'friends')]
#[ORM\JoinColumn(nullable: false)]
#[Assert\NotNull()]
private ?User $mainUser = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
#[Assert\NotNull()]
private ?User $friendUser = null;
#[ORM\Column]
#[Assert\NotNull()]
private ?bool $shareFavouriteProducts = true;
#[ORM\Column]
#[Assert\NotNull()]
private ?bool $shareShopping = true;
public function getId(): ?int
{
return $this->id;
}
public function getMainUser(): ?User
{
return $this->mainUser;
}
public function setMainUser(?User $mainUser): self
{
$this->mainUser = $mainUser;
return $this;
}
public function getFriendUser(): ?User
{
return $this->friendUser;
}
public function setFriendUser(?User $friendUser): self
{
$this->friendUser = $friendUser;
return $this;
}
public function isShareFavouriteProducts(): ?bool
{
return $this->shareFavouriteProducts;
}
public function setShareFavouriteProducts(bool $shareFavouriteProducts): self
{
$this->shareFavouriteProducts = $shareFavouriteProducts;
return $this;
}
public function isShareShopping(): ?bool
{
return $this->shareShopping;
}
public function setShareShopping(bool $shareShopping): self
{
$this->shareShopping = $shareShopping;
return $this;
}
}