mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-16 08:28:42 +00:00
l11n, unit/app and simplification fixes
This commit is contained in:
parent
98fb4bcc48
commit
8bbfdb8baf
|
|
@ -43,7 +43,9 @@
|
||||||
"news_lang": {
|
"news_lang": {
|
||||||
"name": "news_lang",
|
"name": "news_lang",
|
||||||
"type": "VARCHAR(2)",
|
"type": "VARCHAR(2)",
|
||||||
"null": false
|
"null": false,
|
||||||
|
"foreignTable": "language",
|
||||||
|
"foreignKey": "language_639_1"
|
||||||
},
|
},
|
||||||
"news_publish": {
|
"news_publish": {
|
||||||
"name": "news_publish",
|
"name": "news_publish",
|
||||||
|
|
@ -56,6 +58,22 @@
|
||||||
"null": true,
|
"null": true,
|
||||||
"default": null
|
"default": null
|
||||||
},
|
},
|
||||||
|
"news_unit": {
|
||||||
|
"name": "news_unit",
|
||||||
|
"type": "INT",
|
||||||
|
"default": null,
|
||||||
|
"null": true,
|
||||||
|
"foreignTable": "organization_unit",
|
||||||
|
"foreignKey": "organization_unit_id"
|
||||||
|
},
|
||||||
|
"news_app": {
|
||||||
|
"name": "news_app",
|
||||||
|
"type": "INT",
|
||||||
|
"default": null,
|
||||||
|
"null": true,
|
||||||
|
"foreignTable": "app",
|
||||||
|
"foreignKey": "app_id"
|
||||||
|
},
|
||||||
"news_created_at": {
|
"news_created_at": {
|
||||||
"name": "news_created_at",
|
"name": "news_created_at",
|
||||||
"type": "DATETIME",
|
"type": "DATETIME",
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,8 @@ final class ApiController extends Controller
|
||||||
$newsArticle->setType((int) ($request->getData('type') ?? $newsArticle->getType()));
|
$newsArticle->setType((int) ($request->getData('type') ?? $newsArticle->getType()));
|
||||||
$newsArticle->setStatus((int) ($request->getData('status') ?? $newsArticle->getStatus()));
|
$newsArticle->setStatus((int) ($request->getData('status') ?? $newsArticle->getStatus()));
|
||||||
$newsArticle->isFeatured = (bool) ($request->getData('featured') ?? $newsArticle->isFeatured);
|
$newsArticle->isFeatured = (bool) ($request->getData('featured') ?? $newsArticle->isFeatured);
|
||||||
|
$newsArticle->unit = $request->getData('unit', 'int');
|
||||||
|
$newsArticle->app = $request->getData('app', 'int');
|
||||||
|
|
||||||
return $newsArticle;
|
return $newsArticle;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,22 @@ class NewsArticle implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
private string $language = ISO639x1Enum::_EN;
|
private string $language = ISO639x1Enum::_EN;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit
|
||||||
|
*
|
||||||
|
* @var null|int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public ?int $unit = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Application
|
||||||
|
*
|
||||||
|
* @var null|int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public ?int $app = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created.
|
* Created.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ final class NewsArticleMapper extends DataMapperFactory
|
||||||
'news_type' => ['name' => 'news_type', 'type' => 'int', 'internal' => 'type'],
|
'news_type' => ['name' => 'news_type', 'type' => 'int', 'internal' => 'type'],
|
||||||
'news_featured' => ['name' => 'news_featured', 'type' => 'bool', 'internal' => 'isFeatured'],
|
'news_featured' => ['name' => 'news_featured', 'type' => 'bool', 'internal' => 'isFeatured'],
|
||||||
'news_comment_list' => ['name' => 'news_comment_list', 'type' => 'int', 'internal' => 'comments'],
|
'news_comment_list' => ['name' => 'news_comment_list', 'type' => 'int', 'internal' => 'comments'],
|
||||||
|
'news_unit' => ['name' => 'news_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||||
|
'news_app' => ['name' => 'news_app', 'type' => 'int', 'internal' => 'app'],
|
||||||
'news_created_at' => ['name' => 'news_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
'news_created_at' => ['name' => 'news_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||||
'news_created_by' => ['name' => 'news_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
'news_created_by' => ['name' => 'news_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user