diff --git a/app/modules/tag/TagModule.php b/app/modules/tag/TagModule.php index 539f71a..af1d2b4 100644 --- a/app/modules/tag/TagModule.php +++ b/app/modules/tag/TagModule.php @@ -87,8 +87,14 @@ class TagModule extends Module } - public function getItems(string $entity, Model $model): array + public function getItems(string $entity, Model $model): array|string { - return TagEntity::where("entity", $entity)->where("entity_id", $model->id)->with("tag")->get()->toArray(); + $tags = TagEntity::where("entity", $entity)->where("entity_id", $model->id)->with("tag")->get(); + $tagsStr = ""; + foreach ($tags as $tag) { + $tagsStr .= $tag->tag->label . ", "; + } + + return substr($tagsStr, 0, -2); } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index da515a7..315e67a 100644 --- a/composer.lock +++ b/composer.lock @@ -275,16 +275,16 @@ }, { "name": "firebase/php-jwt", - "version": "v6.10.1", + "version": "v6.10.2", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "500501c2ce893c824c801da135d02661199f60c5" + "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5", - "reference": "500501c2ce893c824c801da135d02661199f60c5", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b", + "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b", "shasum": "" }, "require": { @@ -332,9 +332,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.1" + "source": "https://github.com/firebase/php-jwt/tree/v6.10.2" }, - "time": "2024-05-18T18:05:11+00:00" + "time": "2024-11-24T11:22:49+00:00" }, { "name": "graham-campbell/result-type", @@ -725,16 +725,16 @@ }, { "name": "illuminate/collections", - "version": "v11.28.1", + "version": "v11.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "2d99ccbb19e34450508ff3ab2f62ba90aa2e9793" + "reference": "fd2103ddc121449a7926fc34a9d220e5b88183c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/2d99ccbb19e34450508ff3ab2f62ba90aa2e9793", - "reference": "2d99ccbb19e34450508ff3ab2f62ba90aa2e9793", + "url": "https://api.github.com/repos/illuminate/collections/zipball/fd2103ddc121449a7926fc34a9d220e5b88183c1", + "reference": "fd2103ddc121449a7926fc34a9d220e5b88183c1", "shasum": "" }, "require": { @@ -776,20 +776,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-10-10T19:23:07+00:00" + "time": "2024-11-27T14:51:56+00:00" }, { "name": "illuminate/conditionable", - "version": "v11.28.1", + "version": "v11.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", - "reference": "362dd761b9920367bca1427a902158225e9e3a23" + "reference": "911df1bda950a3b799cf80671764e34eede131c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/conditionable/zipball/362dd761b9920367bca1427a902158225e9e3a23", - "reference": "362dd761b9920367bca1427a902158225e9e3a23", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/911df1bda950a3b799cf80671764e34eede131c6", + "reference": "911df1bda950a3b799cf80671764e34eede131c6", "shasum": "" }, "require": { @@ -822,20 +822,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-06-28T20:10:30+00:00" + "time": "2024-11-21T16:28:56+00:00" }, { "name": "illuminate/container", - "version": "v11.28.1", + "version": "v11.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "06dfc614aff58384b28ba5ad191f6a02d6b192cb" + "reference": "b057b0bbb38d7c7524df1ca5c38e7318f4c64d26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/06dfc614aff58384b28ba5ad191f6a02d6b192cb", - "reference": "06dfc614aff58384b28ba5ad191f6a02d6b192cb", + "url": "https://api.github.com/repos/illuminate/container/zipball/b057b0bbb38d7c7524df1ca5c38e7318f4c64d26", + "reference": "b057b0bbb38d7c7524df1ca5c38e7318f4c64d26", "shasum": "" }, "require": { @@ -873,20 +873,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-10-11T15:30:11+00:00" + "time": "2024-11-21T20:07:31+00:00" }, { "name": "illuminate/contracts", - "version": "v11.28.1", + "version": "v11.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "56312862af937bd6da8e6dc8bbd88188dfb478f8" + "reference": "184317f701ba20ca265e36808ed54b75b115972d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/56312862af937bd6da8e6dc8bbd88188dfb478f8", - "reference": "56312862af937bd6da8e6dc8bbd88188dfb478f8", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/184317f701ba20ca265e36808ed54b75b115972d", + "reference": "184317f701ba20ca265e36808ed54b75b115972d", "shasum": "" }, "require": { @@ -921,7 +921,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-09-22T15:08:08+00:00" + "time": "2024-11-25T15:33:38+00:00" }, { "name": "illuminate/database", @@ -1060,7 +1060,7 @@ }, { "name": "illuminate/macroable", - "version": "v11.28.1", + "version": "v11.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1106,16 +1106,16 @@ }, { "name": "illuminate/support", - "version": "v11.28.1", + "version": "v11.34.2", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "bd0983d4a22eccde1773809d4897bb533c3f26fd" + "reference": "2b718a86571baed50fdc5d5748a846c2e58e07eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/bd0983d4a22eccde1773809d4897bb533c3f26fd", - "reference": "bd0983d4a22eccde1773809d4897bb533c3f26fd", + "url": "https://api.github.com/repos/illuminate/support/zipball/2b718a86571baed50fdc5d5748a846c2e58e07eb", + "reference": "2b718a86571baed50fdc5d5748a846c2e58e07eb", "shasum": "" }, "require": { @@ -1127,9 +1127,9 @@ "illuminate/conditionable": "^11.0", "illuminate/contracts": "^11.0", "illuminate/macroable": "^11.0", - "nesbot/carbon": "^2.72.2|^3.0", + "nesbot/carbon": "^2.72.2|^3.4", "php": "^8.2", - "voku/portable-ascii": "^2.0" + "voku/portable-ascii": "^2.0.2" }, "conflict": { "tightenco/collect": "<5.5.33" @@ -1145,7 +1145,7 @@ "symfony/process": "Required to use the composer class (^7.0).", "symfony/uid": "Required to use Str::ulid() (^7.0).", "symfony/var-dumper": "Required to use the dd function (^7.0).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.6.1)." }, "type": "library", "extra": { @@ -1178,7 +1178,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-10-16T16:25:45+00:00" + "time": "2024-11-27T14:58:17+00:00" }, { "name": "itguild/eloquent-table", @@ -1276,11 +1276,11 @@ }, { "name": "itguild/tables", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://git.itguild.info/ItGuild/tables", - "reference": "5f46431d4562d2b4d8bff43b446fef82ecf73b83" + "reference": "5effacf12fd68d31181304562deb7331cf42c1db" }, "type": "library", "autoload": { @@ -1298,7 +1298,7 @@ "email": "apuc06@mail.ru" } ], - "time": "2024-10-11T13:31:11+00:00" + "time": "2024-11-28T08:57:17+00:00" }, { "name": "josantonius/session", @@ -1503,20 +1503,20 @@ }, { "name": "nesbot/carbon", - "version": "3.8.0", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f" + "reference": "e1268cdbc486d97ce23fef2c666dc3c6b6de9947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbd3eef89af8ba66a3aa7952b5439168fbcc529f", - "reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e1268cdbc486d97ce23fef2c666dc3c6b6de9947", + "reference": "e1268cdbc486d97ce23fef2c666dc3c6b6de9947", "shasum": "" }, "require": { - "carbonphp/carbon-doctrine-types": "*", + "carbonphp/carbon-doctrine-types": "<100.0", "ext-json": "*", "php": "^8.1", "psr/clock": "^1.0", @@ -1605,7 +1605,7 @@ "type": "tidelift" } ], - "time": "2024-08-19T06:22:39+00:00" + "time": "2024-11-07T17:46:48+00:00" }, { "name": "phpoption/phpoption", @@ -2139,16 +2139,16 @@ }, { "name": "symfony/clock", - "version": "v7.1.1", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", - "reference": "3dfc8b084853586de51dd1441c6242c76a28cbe7" + "reference": "97bebc53548684c17ed696bc8af016880f0f098d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/clock/zipball/3dfc8b084853586de51dd1441c6242c76a28cbe7", - "reference": "3dfc8b084853586de51dd1441c6242c76a28cbe7", + "url": "https://api.github.com/repos/symfony/clock/zipball/97bebc53548684c17ed696bc8af016880f0f098d", + "reference": "97bebc53548684c17ed696bc8af016880f0f098d", "shasum": "" }, "require": { @@ -2193,7 +2193,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v7.1.1" + "source": "https://github.com/symfony/clock/tree/v7.1.6" }, "funding": [ { @@ -2209,20 +2209,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -2260,7 +2260,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -2276,20 +2276,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/finder", - "version": "v7.1.4", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" + "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", + "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", + "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", "shasum": "" }, "require": { @@ -2324,7 +2324,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.4" + "source": "https://github.com/symfony/finder/tree/v7.1.6" }, "funding": [ { @@ -2340,7 +2340,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:28:19+00:00" + "time": "2024-10-01T08:31:23+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2735,16 +2735,16 @@ }, { "name": "symfony/translation", - "version": "v7.1.5", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea" + "reference": "b9f72ab14efdb6b772f85041fa12f820dee8d55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/235535e3f84f3dfbdbde0208ede6ca75c3a489ea", - "reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea", + "url": "https://api.github.com/repos/symfony/translation/zipball/b9f72ab14efdb6b772f85041fa12f820dee8d55f", + "reference": "b9f72ab14efdb6b772f85041fa12f820dee8d55f", "shasum": "" }, "require": { @@ -2809,7 +2809,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.1.5" + "source": "https://github.com/symfony/translation/tree/v7.1.6" }, "funding": [ { @@ -2825,20 +2825,20 @@ "type": "tidelift" } ], - "time": "2024-09-16T06:30:38+00:00" + "time": "2024-09-28T12:35:13+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a" + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", - "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/4667ff3bd513750603a09c8dedbea942487fb07c", + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c", "shasum": "" }, "require": { @@ -2887,7 +2887,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.1" }, "funding": [ { @@ -2903,7 +2903,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "twbs/bootstrap", @@ -2957,16 +2957,16 @@ }, { "name": "twig/twig", - "version": "v3.14.0", + "version": "v3.15.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72" + "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/2d5b3964cc21d0188633d7ddce732dc8e874db02", + "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02", "shasum": "" }, "require": { @@ -3020,7 +3020,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.14.0" + "source": "https://github.com/twigphp/Twig/tree/v3.15.0" }, "funding": [ { @@ -3032,7 +3032,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T17:55:12+00:00" + "time": "2024-11-17T15:59:19+00:00" }, { "name": "vlucas/phpdotenv", @@ -3120,16 +3120,16 @@ }, { "name": "voku/portable-ascii", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "b56450eed252f6801410d810c8e1727224ae0743" + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", - "reference": "b56450eed252f6801410d810c8e1727224ae0743", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", "shasum": "" }, "require": { @@ -3154,7 +3154,7 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", @@ -3166,7 +3166,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.1" + "source": "https://github.com/voku/portable-ascii/tree/2.0.3" }, "funding": [ { @@ -3190,7 +3190,7 @@ "type": "tidelift" } ], - "time": "2022-03-08T17:03:00+00:00" + "time": "2024-11-21T01:49:47+00:00" } ], "packages-dev": [], @@ -3205,5 +3205,5 @@ "ext-zip": "*" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/kernel/EntityRelation.php b/kernel/EntityRelation.php index f126b84..b387a70 100644 --- a/kernel/EntityRelation.php +++ b/kernel/EntityRelation.php @@ -190,12 +190,15 @@ class EntityRelation { $relations = $this->getEntityRelationsBySlug($entity); if ($relations){ + $relationsArr = []; foreach ($relations as $relation){ $moduleClass = $this->getAdditionalPropertyClassBySlug($relation); if ($moduleClass and method_exists($moduleClass, "getItems")) { - return $moduleClass->getItems($entity, $model); + $relationsArr[$relation] = $moduleClass->getItems($entity, $model); } } + + return $relationsArr; } return []; diff --git a/kernel/modules/post/views/view.php b/kernel/modules/post/views/view.php index 9b129e0..e3693d1 100644 --- a/kernel/modules/post/views/view.php +++ b/kernel/modules/post/views/view.php @@ -26,17 +26,23 @@ $table->beforePrint(function () use ($content) { }); $entityRelation = new \kernel\EntityRelation(); -$additional = $entityRelation->getEntityAdditionalProperty("post", $content); +$additionals = $entityRelation->getEntityAdditionalProperty("post", $content); + +foreach ($additionals as $key => $additional) { + $table->addRow($key, function () use ($additional) { + return $additional; + }, ['after' => 'user_id']); +} $table->rows([ 'created_at' => function ($data) { - if (!$data){ + if (!$data) { return null; } return (new DateTimeImmutable($data))->format("d-m-Y"); }, 'updated_at' => function ($data) { - if (!$data){ + if (!$data) { return null; } return (new DateTimeImmutable($data))->format("d-m-Y");