init activity features #4

This commit is contained in:
ghost 2023-10-10 23:42:45 +03:00
parent c47c8ad83b
commit ef84fefca3
27 changed files with 1492 additions and 143 deletions

View file

@ -3,6 +3,7 @@
namespace App\Entity;
use App\Repository\ActivityRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ActivityRepository::class)]
@ -13,18 +14,62 @@ class Activity
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $event = null;
#[ORM\Column]
private ?int $event = null;
// Event codes
/// User
public const EVENT_USER_ADD = 10000;
public const EVENT_USER_APPROVE_ADD = 10200;
public const EVENT_USER_APPROVE_DELETE = 10210;
public const EVENT_USER_MODERATOR_ADD = 10300;
public const EVENT_USER_MODERATOR_DELETE = 10310;
public const EVENT_USER_STATUS_ADD = 10400;
public const EVENT_USER_STATUS_DELETE = 10410;
public const EVENT_USER_STAR_ADD = 10500;
public const EVENT_USER_STAR_DELETE = 10510;
/// Torrent
public const EVENT_TORRENT_ADD = 20000;
public const EVENT_TORRENT_LOCALES_ADD = 20100;
public const EVENT_TORRENT_LOCALES_DELETE = 20101;
public const EVENT_TORRENT_LOCALES_APPROVE_ADD = 20110;
public const EVENT_TORRENT_LOCALES_APPROVE_DELETE = 20111;
public const EVENT_TORRENT_SENSITIVE_ADD = 20200;
public const EVENT_TORRENT_SENSITIVE_DELETE = 20201;
public const EVENT_TORRENT_SENSITIVE_APPROVE_ADD = 20210;
public const EVENT_TORRENT_SENSITIVE_APPROVE_DELETE = 20211;
public const EVENT_TORRENT_DOWNLOAD_FILE_ADD = 20300;
public const EVENT_TORRENT_DOWNLOAD_MAGNET_ADD = 20400;
/// Article
public const EVENT_ARTICLE_ADD = 30000;
// ...
#[ORM\Column]
private ?int $added = null;
#[ORM\Column(nullable: true)]
private ?int $userId = null;
#[ORM\Column(nullable: true)]
private ?int $articleId = null;
#[ORM\Column(nullable: true)]
private ?int $torrentId = null;
#[ORM\Column]
private ?int $added = null;
#[ORM\Column(type: Types::ARRAY)]
private array $data = [];
public function getId(): ?int
{
return $this->id;
@ -37,37 +82,18 @@ class Activity
return $this;
}
public function getEvent(): ?string
public function getEvent(): ?int
{
return $this->event;
}
public function setEvent(string $event): static
public function setEvent(int $event): static
{
$this->event = $event;
return $this;
}
public function getAdded(): ?int
{
return $this->added;
}
public function setAdded(int $added): static
{
$this->added = $added;
return $this;
}
public function setApproved(bool $approved): static
{
$this->approved = $approved;
return $this;
}
public function getUserId(): ?int
{
return $this->userId;
@ -85,15 +111,46 @@ class Activity
return $this->articleId;
}
public function setArticleId(?int $articleId): static
public function setArticleId(int $articleId): static
{
$this->articleId = $articleId;
return $this;
}
public function isApproved(): ?bool
public function getTorrentId(): ?int
{
return $this->approved;
return $this->torrentId;
}
public function setTorrentId(?int $torrentId): static
{
$this->torrentId = $torrentId;
return $this;
}
public function getAdded(): ?int
{
return $this->added;
}
public function setAdded(int $added): static
{
$this->added = $added;
return $this;
}
public function getData(): array
{
return $this->data;
}
public function setData(array $data): static
{
$this->data = $data;
return $this;
}
}