entity relation save
This commit is contained in:
@ -6,9 +6,12 @@ namespace kernel\modules\post\controllers;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\NoReturn;
|
||||
use kernel\AdminController;
|
||||
use kernel\EntityRelation;
|
||||
use kernel\helpers\Debug;
|
||||
use kernel\modules\post\models\forms\CreatePostForm;
|
||||
use kernel\modules\post\models\Post;
|
||||
use kernel\modules\post\service\PostService;
|
||||
use kernel\Request;
|
||||
|
||||
class PostController extends AdminController
|
||||
{
|
||||
@ -31,6 +34,10 @@ class PostController extends AdminController
|
||||
$postForm->load($_REQUEST);
|
||||
if ($postForm->validate()) {
|
||||
$post = $this->postService->create($postForm);
|
||||
|
||||
$entityRelation = new EntityRelation();
|
||||
$entityRelation->saveEntityRelation("post", new Request());
|
||||
|
||||
if ($post) {
|
||||
$this->redirect("/admin/post/view/" . $post->id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user