easy-message/src/Template/AbstractTemplate.php

70 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace EasyMessage\Template;
use EasyMessage\Contracts\EasyMessageInterface;
abstract class AbstractTemplate
{
protected array $at = [];
protected string $pipeline = EasyMessageInterface::INFO;
protected string $text = '';
protected string $title = '';
public function getText(): string
{
return $this->text;
}
public function setText(string $text): AbstractTemplate
{
$this->text = $text;
return $this;
}
public function getTitle(): string
{
return $this->title;
}
public function setTitle(string $title): AbstractTemplate
{
$this->title = $title;
return $this;
}
public function getPipeline(): string
{
return $this->pipeline;
}
public function setPipeline(string $pipeline): AbstractTemplate
{
$this->pipeline = $pipeline;
return $this;
}
public function setAt(array $at = []): AbstractTemplate
{
$this->at = $at;
return $this;
}
public function getAt(): array
{
return $this->at;
}
public function isAtAll(): bool
{
return in_array('all', $this->at) || in_array('ALL', $this->at);
}
abstract public function getBody();
}