45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Mangboard;
|
|
|
|
use App\Entities\CommonEntity;
|
|
use App\Models\Mangboard\BoardModel;
|
|
|
|
class BoardEntity extends CommonEntity
|
|
{
|
|
public function __toString(): string
|
|
{
|
|
return "{$this->getPK()}|{$this->getTitle()}";
|
|
}
|
|
public function getTitle(): string
|
|
{
|
|
return $this->attributes[BoardModel::TITLE];
|
|
}
|
|
public function setTitle(string $title): void
|
|
{
|
|
$this->attributes[BoardModel::TITLE] = $title;
|
|
}
|
|
//Common Function
|
|
|
|
public function getPK(): int
|
|
{
|
|
return $this->attributes[BoardModel::PK];
|
|
}
|
|
public function getImagePath(): string
|
|
{
|
|
return $this->attributes['image_path'];
|
|
}
|
|
public function setImagePath(string $image_path): void
|
|
{
|
|
$this->attributes['image_path'] = $image_path;
|
|
}
|
|
public function getContent(): string
|
|
{
|
|
return $this->attributes['content'];
|
|
}
|
|
public function setContent(string $content): void
|
|
{
|
|
$this->attributes['content'] = $content;
|
|
}
|
|
}
|