Skip to content

Commit cd4bd1e

Browse files
committed
Move NewsCategory class to News\Category
1 parent 578aa8b commit cd4bd1e

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/Controllers/News/Create.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use \BNETDocs\Libraries\Core\HttpCode;
66
use \BNETDocs\Libraries\Core\Router;
77
use \BNETDocs\Libraries\EventLog\Logger;
8-
use \BNETDocs\Libraries\NewsCategory;
98
use \BNETDocs\Models\News\Create as CreateModel;
109

1110
class Create extends \BNETDocs\Controllers\Base
@@ -33,7 +32,7 @@ public function invoke(?array $args): bool
3332
return true;
3433
}
3534

36-
$this->model->news_categories = NewsCategory::getAll();
35+
$this->model->news_categories = \BNETDocs\Libraries\News\Category::getAll();
3736
usort($this->model->news_categories, function($a, $b){
3837
$oA = $a->getSortId();
3938
$oB = $b->getSortId();

src/Controllers/News/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function invoke(?array $args): bool
3939
return true;
4040
}
4141

42-
$this->model->news_categories = \BNETDocs\Libraries\NewsCategory::getAll();
42+
$this->model->news_categories = \BNETDocs\Libraries\News\Category::getAll();
4343
usort($this->model->news_categories, function($a, $b){
4444
$oA = $a->getSortId();
4545
$oB = $b->getSortId();

src/Exceptions/NewsCategoryNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class NewsCategoryNotFoundException extends DatabaseObjectNotFoundException
66
{
7-
public function __construct(\BNETDocs\Libraries\NewsCategory|int $value, \Throwable $previous = null)
7+
public function __construct(\BNETDocs\Libraries\News\Category|int $value, \Throwable $previous = null)
88
{
99
$v = is_int($value) ? $value : $value->getId();
1010
parent::__construct(\sprintf('News Category not found: %d', $v), 0, $previous);

src/Libraries/NewsCategory.php renamed to src/Libraries/News/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace BNETDocs\Libraries;
3+
namespace BNETDocs\Libraries\News;
44

55
use \BNETDocs\Libraries\Db\MariaDb;
66
use \StdClass;
77

8-
class NewsCategory implements \BNETDocs\Interfaces\DatabaseObject, \JsonSerializable
8+
class Category implements \BNETDocs\Interfaces\DatabaseObject, \JsonSerializable
99
{
1010
public const MAX_FILENAME = 255;
1111
public const MAX_LABEL = 255;

src/Libraries/News/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use \BNETDocs\Libraries\Core\DateTimeImmutable;
66
use \BNETDocs\Libraries\Db\MariaDb;
7-
use \BNETDocs\Libraries\NewsCategory;
7+
use \BNETDocs\Libraries\News\Category as NewsCategory;
88
use \BNETDocs\Libraries\User;
99
use \CarlBennett\MVC\Libraries\Common;
1010
use \DateTimeInterface;

0 commit comments

Comments
 (0)