Create repository for logs

[MAILPOET-3135]
This commit is contained in:
Pavel Dohnal
2021-03-02 10:46:08 +01:00
committed by Veljko V
parent 9fe84dd42d
commit 174583cc84
3 changed files with 71 additions and 0 deletions

View File

@ -13,6 +13,7 @@ class Logs {
}
public function render() {
$this->pageRenderer->displayPage('logs.html', []);
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace MailPoet\Entities;
use MailPoet\Doctrine\EntityTraits\AutoincrementedIdTrait;
use MailPoet\Doctrine\EntityTraits\CreatedAtTrait;
use MailPoetVendor\Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
* @ORM\Table(name="logs")
*/
class LogEntity {
use AutoincrementedIdTrait;
use CreatedAtTrait;
/**
* @ORM\Column(type="string", nullable=true)
* @var string|null
*/
private $name;
/**
* @ORM\Column(type="int", nullable=true)
* @var int|null
*/
private $level;
/**
* @ORM\Column(type="string", nullable=true)
* @var string|null
*/
private $message;
/**
* @return string|null
*/
public function getName(): ?string {
return $this->name;
}
/**
* @return int|null
*/
public function getLevel(): ?int {
return $this->level;
}
/**
* @return string|null
*/
public function getMessage(): ?string {
return $this->message;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace MailPoet\Logging;
use MailPoet\Doctrine\Repository;
use MailPoet\Entities\LogEntity;
/**
* @extends Repository<LogEntity>
*/
class LogRepository extends Repository {
protected function getEntityClassName() {
return LogEntity::class;
}
}