mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-18 17:38:42 +00:00
Fix minor bugs for full inspections
This commit is contained in:
parent
b72c2e0d7f
commit
d2631f9a7d
|
|
@ -17,6 +17,7 @@ namespace Modules\News\Admin;
|
||||||
use phpOMS\DataStorage\Database\DatabasePool;
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
use phpOMS\DataStorage\Database\Schema\Builder;
|
use phpOMS\DataStorage\Database\Schema\Builder;
|
||||||
use phpOMS\Module\UninstallAbstract;
|
use phpOMS\Module\UninstallAbstract;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigation class.
|
* Navigation class.
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ namespace Modules\News\Admin;
|
||||||
use phpOMS\DataStorage\Database\DatabasePool;
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
use phpOMS\Module\UpdateAbstract;
|
use phpOMS\Module\UpdateAbstract;
|
||||||
use phpOMS\System\File\Directory;
|
use phpOMS\System\File\Directory;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigation class.
|
* Navigation class.
|
||||||
|
|
@ -33,7 +35,7 @@ class Update extends UpdateAbstract
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static function update(DatabasePool $dbPool, array $info)
|
public static function update(DatabasePool $dbPool, InfoManager $info)
|
||||||
{
|
{
|
||||||
Directory::deletePath(__DIR__ . '/Update');
|
Directory::deletePath(__DIR__ . '/Update');
|
||||||
mkdir('Update');
|
mkdir('Update');
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
|
||||||
public function setType(int $type)
|
public function setType(int $type)
|
||||||
{
|
{
|
||||||
if(!NewsType::isValidValue($type)) {
|
if(!NewsType::isValidValue($type)) {
|
||||||
throw new InvalidEnumValue($type);
|
throw new InvalidEnumValue((string) $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
|
|
@ -361,7 +361,7 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
|
||||||
public function setStatus(int $status)
|
public function setStatus(int $status)
|
||||||
{
|
{
|
||||||
if(!NewsStatus::isValidValue($status)) {
|
if(!NewsStatus::isValidValue($status)) {
|
||||||
throw new InvalidEnumValue($status);
|
throw new InvalidEnumValue((string) $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
|
|
@ -399,8 +399,8 @@ class NewsArticle implements ArrayableInterface, \JsonSerializable
|
||||||
'type' => $this->type,
|
'type' => $this->type,
|
||||||
'status' => $this->status,
|
'status' => $this->status,
|
||||||
'featured' => $this->featured,
|
'featured' => $this->featured,
|
||||||
'publish' => $this->publish,
|
'publish' => $this->publish->format('Y-m-d H:i:s'),
|
||||||
'createdAt' => $this->createdAt,
|
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'),
|
||||||
'createdBy' => $this->createdBy,
|
'createdBy' => $this->createdBy,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user