Create repository for logs
[MAILPOET-3135]
This commit is contained in:
@ -13,6 +13,7 @@ class Logs {
|
||||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
$this->pageRenderer->displayPage('logs.html', []);
|
||||
}
|
||||
}
|
||||
|
55
lib/Entities/LogEntity.php
Normal file
55
lib/Entities/LogEntity.php
Normal 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;
|
||||
}
|
||||
}
|
15
lib/Logging/LogRepository.php
Normal file
15
lib/Logging/LogRepository.php
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user