replace annotation with attributes
This commit is contained in:
parent
e130a42a57
commit
7dc463d14a
|
@ -2,6 +2,8 @@
|
|||
|
||||
### Fixed
|
||||
* fix tinymce modal z-index in tox
|
||||
### Changed
|
||||
* replace annotation with attributes
|
||||
|
||||
## [1.16.0] - 2022-09-06
|
||||
### Added
|
||||
|
|
|
@ -14,14 +14,10 @@ use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
|||
use Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface;
|
||||
use ZxcvbnPhp\Zxcvbn;
|
||||
|
||||
/**
|
||||
* @Route("/admin/account")
|
||||
*/
|
||||
#[Route(path: '/admin/account')]
|
||||
class AccountAdminController extends AdminController
|
||||
{
|
||||
/**
|
||||
* @Route("/", name="admin_account")
|
||||
*/
|
||||
#[Route(path: '/', name: 'admin_account')]
|
||||
public function account(Request $request, TotpAuthenticatorInterface $totpAuthenticatorService): Response
|
||||
{
|
||||
$account = $this->getUser();
|
||||
|
@ -31,9 +27,7 @@ class AccountAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/2fa", name="admin_account_2fa")
|
||||
*/
|
||||
#[Route(path: '/2fa', name: 'admin_account_2fa')]
|
||||
public function twoFactorAuthentication(
|
||||
Request $request,
|
||||
GoogleAuthenticatorInterface $totpAuthenticatorService,
|
||||
|
@ -93,9 +87,7 @@ class AccountAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/password", name="admin_account_password", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/password', name: 'admin_account_password', methods: ['POST'])]
|
||||
public function password(
|
||||
Request $request,
|
||||
UserRepository $repository,
|
||||
|
|
|
@ -9,9 +9,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
abstract class AdminController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/_ping", name="_ping")
|
||||
*/
|
||||
#[Route(path: '/_ping', name: '_ping')]
|
||||
public function ping()
|
||||
{
|
||||
return $this->json(true);
|
||||
|
|
|
@ -8,14 +8,10 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/admin/analytic")
|
||||
*/
|
||||
#[Route(path: '/admin/analytic')]
|
||||
class AnalyticController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/stats/{node}/{range}", name="admin_analytic_stats")
|
||||
*/
|
||||
#[Route(path: '/stats/{node}/{range}', name: 'admin_analytic_stats')]
|
||||
public function stats(Node $node, DateRangeAnalytic $analytic, string $range = '7days'): Response
|
||||
{
|
||||
if (!in_array($range, ['7days', '30days', '90days', '1year'])) {
|
||||
|
|
|
@ -25,9 +25,7 @@ class AuthController extends AbstractController
|
|||
$this->coreParameters = $parameters->get('core');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/login", name="auth_login")
|
||||
*/
|
||||
#[Route(path: '/login', name: 'auth_login')]
|
||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||
{
|
||||
if ($this->getUser()) {
|
||||
|
@ -45,9 +43,7 @@ class AuthController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/resetting/request", name="auth_resetting_request")
|
||||
*/
|
||||
#[Route(path: '/resetting/request', name: 'auth_resetting_request')]
|
||||
public function requestResetting(Request $request, UserRepository $repository, EventDispatcherInterface $eventDispatcher): Response
|
||||
{
|
||||
if ($this->getUser()) {
|
||||
|
@ -85,9 +81,7 @@ class AuthController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/resetting/update/{token}", name="auth_resetting_update")
|
||||
*/
|
||||
#[Route(path: '/resetting/update/{token}', name: 'auth_resetting_update')]
|
||||
public function requestUpdate(
|
||||
string $token,
|
||||
Request $request,
|
||||
|
@ -145,9 +139,7 @@ class AuthController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/logout", name="auth_logout")
|
||||
*/
|
||||
#[Route(path: '/logout', name: 'auth_logout')]
|
||||
public function logout()
|
||||
{
|
||||
throw new \Exception('This method can be blank - it will be intercepted by the logout key on your firewall');
|
||||
|
|
|
@ -9,14 +9,10 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
|
||||
/**
|
||||
* @Route("/admin/editor/editorjs")
|
||||
*/
|
||||
#[Route(path: '/admin/editor/editorjs')]
|
||||
class EditorJsController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/fetch_url", name="admin_editor_editorjs_fetch_url", options={"expose"=true})
|
||||
*/
|
||||
#[Route(path: '/fetch_url', name: 'admin_editor_editorjs_fetch_url', options: ['expose' => true])]
|
||||
public function fetchUrl(Request $request, HttpClientInterface $client): JsonResponse
|
||||
{
|
||||
$url = filter_var($request->query->get('url'), FILTER_VALIDATE_URL);
|
||||
|
|
|
@ -15,22 +15,16 @@ use Symfony\Component\HttpFoundation\Response;
|
|||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* @Route("/admin/file_manager")
|
||||
*/
|
||||
#[Route(path: '/admin/file_manager')]
|
||||
class FileManagerAdminController extends AdminController
|
||||
{
|
||||
/**
|
||||
* @Route("/", name="admin_file_manager_index")
|
||||
*/
|
||||
#[Route(path: '/', name: 'admin_file_manager_index')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('@Core/file_manager/index.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/api/directory", name="admin_file_manager_api_directory", options={"expose"=true})
|
||||
*/
|
||||
#[Route(path: '/api/directory', name: 'admin_file_manager_api_directory', options: ['expose' => true])]
|
||||
public function directory(FsFileManager $manager, Request $request): Response
|
||||
{
|
||||
$options = [
|
||||
|
@ -43,9 +37,7 @@ class FileManagerAdminController extends AdminController
|
|||
return $this->json($files);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/info/{tab}/{context}/{ajax}", name="admin_file_manager_info", options={"expose"=true})
|
||||
*/
|
||||
#[Route(path: '/info/{tab}/{context}/{ajax}', name: 'admin_file_manager_info', options: ['expose' => true])]
|
||||
public function info(
|
||||
FsFileManager $manager,
|
||||
Request $request,
|
||||
|
@ -115,9 +107,7 @@ class FileManagerAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/directory/new/{ajax}", name="admin_file_manager_directory_new", options={"expose"=true}, methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/directory/new/{ajax}', name: 'admin_file_manager_directory_new', options: ['expose' => true], methods: ['GET', 'POST'])]
|
||||
public function directoryNew(FsFileManager $manager, Request $request, TranslatorInterface $translator, bool $ajax = false): Response
|
||||
{
|
||||
$splInfo = $manager->getSplInfo($request->query->get('file'));
|
||||
|
@ -184,9 +174,7 @@ class FileManagerAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/directory/rename/{ajax}", name="admin_file_manager_directory_rename", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/directory/rename/{ajax}', name: 'admin_file_manager_directory_rename', methods: ['GET', 'POST'])]
|
||||
public function directoryRename(FsFileManager $manager, Request $request, TranslatorInterface $translator, bool $ajax = false): Response
|
||||
{
|
||||
$splInfo = $manager->getSplInfo($request->query->get('file'));
|
||||
|
@ -255,9 +243,7 @@ class FileManagerAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/file/rename/{ajax}", name="admin_file_manager_file_rename", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/file/rename/{ajax}', name: 'admin_file_manager_file_rename', methods: ['GET', 'POST'])]
|
||||
public function fileRename(FsFileManager $manager, Request $request, TranslatorInterface $translator, bool $ajax = false): Response
|
||||
{
|
||||
$splInfo = $manager->getSplInfo($request->query->get('file'));
|
||||
|
@ -327,9 +313,7 @@ class FileManagerAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/upload/{ajax}", name="admin_file_manager_upload", options={"expose"=true}, methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/upload/{ajax}', name: 'admin_file_manager_upload', options: ['expose' => true], methods: ['GET', 'POST'])]
|
||||
public function upload(FsFileManager $manager, Request $request, TranslatorInterface $translator, bool $ajax = false): Response
|
||||
{
|
||||
$splInfo = $manager->getSplInfo($request->query->get('file'));
|
||||
|
@ -406,9 +390,7 @@ class FileManagerAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/delete", name="admin_file_manager_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/delete', name: 'admin_file_manager_delete', methods: ['DELETE'])]
|
||||
public function delete(FsFileManager $manager, Request $request): Response
|
||||
{
|
||||
$path = $request->request->get('file');
|
||||
|
|
|
@ -19,65 +19,49 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
class RedirectAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/redirect/{page}", name="admin_redirect_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/{page}', name: 'admin_redirect_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/redirect/new", name="admin_redirect_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/new', name: 'admin_redirect_new', methods: ['GET', 'POST'])]
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/redirect/show/{entity}", name="admin_redirect_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/show/{entity}', name: 'admin_redirect_show', methods: ['GET'])]
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/redirect/filter", name="admin_redirect_filter", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/filter', name: 'admin_redirect_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/redirect/edit/{entity}", name="admin_redirect_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/edit/{entity}', name: 'admin_redirect_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/redirect/sort/{page}", name="admin_redirect_sort", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/sort/{page}', name: 'admin_redirect_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/redirect/batch/{page}", name="admin_redirect_batch", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/batch/{page}', name: 'admin_redirect_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/redirect/delete/{entity}", name="admin_redirect_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/admin/redirect/delete/{entity}', name: 'admin_redirect_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
|
|
|
@ -11,14 +11,10 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/admin/navigation_setting")
|
||||
*/
|
||||
#[Route(path: '/admin/navigation_setting')]
|
||||
class NavigationSettingAdminController extends AdminController
|
||||
{
|
||||
/**
|
||||
* @Route("/edit/{entity}", name="admin_navigation_setting_edit")
|
||||
*/
|
||||
#[Route(path: '/edit/{entity}', name: 'admin_navigation_setting_edit')]
|
||||
public function edit(
|
||||
Entity $entity,
|
||||
EntityManager $entityManager,
|
||||
|
@ -58,9 +54,7 @@ class NavigationSettingAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/delete/{entity}", name="admin_navigation_setting_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/delete/{entity}', name: 'admin_navigation_setting_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$entity->getId(), $request->request->get('_token'))) {
|
||||
|
|
|
@ -12,14 +12,10 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/menu")
|
||||
*/
|
||||
#[Route(path: '/admin/site/menu')]
|
||||
class MenuAdminController extends AdminController
|
||||
{
|
||||
/**
|
||||
* @Route("/new/{navigation}", name="admin_site_menu_new", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/new/{navigation}', name: 'admin_site_menu_new', methods: ['POST'])]
|
||||
public function new(Navigation $navigation, EntityFactory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
$entity = $factory->create($navigation);
|
||||
|
@ -39,9 +35,7 @@ class MenuAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/edit/{entity}", name="admin_site_menu_edit", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/edit/{entity}', name: 'admin_site_menu_edit', methods: ['POST'])]
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
$form = $this->createForm(EntityType::class, $entity);
|
||||
|
@ -59,9 +53,7 @@ class MenuAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/delete/{entity}", name="admin_site_menu_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/delete/{entity}', name: 'admin_site_menu_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$entity->getId(), $request->request->get('_token'))) {
|
||||
|
|
|
@ -20,25 +20,19 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
class NavigationAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/site/navigation/{page}", name="admin_site_navigation_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/navigation/{page}', name: 'admin_site_navigation_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/navigation/new", name="admin_site_navigation_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/navigation/new', name: 'admin_site_navigation_new', methods: ['GET', 'POST'])]
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/navigation/show/{entity}", name="admin_site_navigation_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/navigation/show/{entity}', name: 'admin_site_navigation_show', methods: ['GET'])]
|
||||
public function show(
|
||||
Entity $entity,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
|
@ -60,33 +54,25 @@ class NavigationAdminController extends CrudController
|
|||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/navigation/filter", name="admin_site_navigation_filter", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/navigation/filter', name: 'admin_site_navigation_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/navigation/edit/{entity}", name="admin_site_navigation_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/navigation/edit/{entity}', name: 'admin_site_navigation_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/navigation/sort/{page}", name="admin_site_navigation_sort", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/navigation/sort/{page}', name: 'admin_site_navigation_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1, ): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/navigation/delete/{entity}", name="admin_site_navigation_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/navigation/delete/{entity}', name: 'admin_site_navigation_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
|
|
|
@ -24,14 +24,10 @@ use Symfony\Component\HttpFoundation\Response;
|
|||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/node")
|
||||
*/
|
||||
#[Route(path: '/admin/site/node')]
|
||||
class NodeAdminController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/new/{node}", name="admin_site_node_new")
|
||||
*/
|
||||
#[Route(path: '/new/{node}', name: 'admin_site_node_new')]
|
||||
public function new(
|
||||
Node $node,
|
||||
EntityFactory $factory,
|
||||
|
@ -103,9 +99,7 @@ class NodeAdminController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/edit/{entity}/{tab}", name="admin_site_node_edit")
|
||||
*/
|
||||
#[Route(path: '/edit/{entity}/{tab}', name: 'admin_site_node_edit')]
|
||||
public function edit(
|
||||
Entity $entity,
|
||||
EntityManager $entityManager,
|
||||
|
@ -166,9 +160,7 @@ class NodeAdminController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/urls/{entity}", name="admin_site_node_urls")
|
||||
*/
|
||||
#[Route(path: '/urls/{entity}', name: 'admin_site_node_urls')]
|
||||
public function urls(Entity $entity, SitemapBuilder $builder): Response
|
||||
{
|
||||
return $this->render('@Core/site/node_admin/urls.html.twig', [
|
||||
|
@ -177,9 +169,7 @@ class NodeAdminController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/move/{entity}", name="admin_site_node_move")
|
||||
*/
|
||||
#[Route(path: '/move/{entity}', name: 'admin_site_node_move')]
|
||||
public function move(
|
||||
Entity $entity,
|
||||
EntityManager $entityManager,
|
||||
|
@ -233,9 +223,7 @@ class NodeAdminController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/toggle/visibility/{entity}", name="admin_site_node_toggle_visibility", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/toggle/visibility/{entity}', name: 'admin_site_node_toggle_visibility', methods: ['POST'])]
|
||||
public function toggleVisibility(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('toggle_visibility'.$entity->getId(), $request->request->get('_token'))) {
|
||||
|
@ -251,9 +239,7 @@ class NodeAdminController extends AbstractController
|
|||
]).sprintf('#node-%d', $entity->getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/delete/{entity}", name="admin_site_node_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/delete/{entity}', name: 'admin_site_node_delete', methods: ['DELETE'])]
|
||||
public function delete(
|
||||
Entity $entity,
|
||||
NodeRepository $nodeRepository,
|
||||
|
|
|
@ -21,33 +21,25 @@ use App\Core\Entity\EntityInterface;
|
|||
|
||||
class PageAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/site/page/{page}", name="admin_site_page_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/page/{page}', name: 'admin_site_page_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/page/show/{entity}", name="admin_site_page_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/page/show/{entity}', name: 'admin_site_page_show', methods: ['GET'])]
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/page/filter", name="admin_site_page_filter", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/page/filter', name: 'admin_site_page_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/page/edit/{entity}", name="admin_site_page_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/page/edit/{entity}', name: 'admin_site_page_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(
|
||||
int $entity,
|
||||
EntityManager $entityManager,
|
||||
|
@ -69,17 +61,13 @@ class PageAdminController extends CrudController
|
|||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/page/delete/{entity}", name="admin_site_page_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/page/delete/{entity}', name: 'admin_site_page_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/page/batch/{page}", name="admin_site_page_batch", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/site/page/batch/{page}', name: 'admin_site_page_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
|
|
|
@ -11,9 +11,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
class SitemapController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/sitemap.xml", name="sitemap")
|
||||
*/
|
||||
#[Route(path: '/sitemap.xml', name: 'sitemap')]
|
||||
public function sitemap(Request $request, NavigationRepositoryQuery $query, SitemapBuilder $builder): Response
|
||||
{
|
||||
$navigations = $query->create()->find();
|
||||
|
|
|
@ -11,14 +11,10 @@ use Symfony\Component\HttpFoundation\Response;
|
|||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/admin/site/tree")
|
||||
*/
|
||||
#[Route(path: '/admin/site/tree')]
|
||||
class TreeAdminController extends AdminController
|
||||
{
|
||||
/**
|
||||
* @Route("/", name="admin_site_tree_index")
|
||||
*/
|
||||
#[Route(path: '/', name: 'admin_site_tree_index')]
|
||||
public function index(NavigationRepositoryQuery $navigationQuery, Session $session): Response
|
||||
{
|
||||
$navigation = null;
|
||||
|
@ -48,9 +44,7 @@ class TreeAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/navigation/{navigation}", name="admin_site_tree_navigation")
|
||||
*/
|
||||
#[Route(path: '/navigation/{navigation}', name: 'admin_site_tree_navigation')]
|
||||
public function navigation(
|
||||
Navigation $navigation,
|
||||
NavigationRepositoryQuery $navigationQuery,
|
||||
|
|
|
@ -13,14 +13,10 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/admin/task")
|
||||
*/
|
||||
#[Route(path: '/admin/task')]
|
||||
class TaskAdminController extends AdminController
|
||||
{
|
||||
/**
|
||||
* @Route("/", name="admin_task_index")
|
||||
*/
|
||||
#[Route(path: '/', name: 'admin_task_index')]
|
||||
public function index(EventDispatcherInterface $eventDispatcher): Response
|
||||
{
|
||||
$event = new TaskInitEvent();
|
||||
|
@ -31,9 +27,7 @@ class TaskAdminController extends AdminController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/run/{task}", name="admin_task_run", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/run/{task}', name: 'admin_task_run', methods: ['GET'])]
|
||||
public function run(
|
||||
string $task,
|
||||
Request $request,
|
||||
|
|
|
@ -20,57 +20,43 @@ use App\Core\Security\TokenGenerator;
|
|||
|
||||
class UserAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/user/{page}", name="admin_user_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
#[Route(path: '/admin/user/{page}', name: 'admin_user_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/user/new", name="admin_user_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/user/new', name: 'admin_user_new', methods: ['GET', 'POST'])]
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request, TokenGenerator $tokenGenerator): Response
|
||||
{
|
||||
return $this->doNew($factory->create(null, $tokenGenerator->generateToken()), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/user/show/{entity}", name="admin_user_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/user/show/{entity}', name: 'admin_user_show', methods: ['GET'])]
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/user/filter", name="admin_user_filter", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/admin/user/filter', name: 'admin_user_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/user/edit/{entity}", name="admin_user_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/user/edit/{entity}', name: 'admin_user_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/user/delete/{entity}", name="admin_user_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/admin/user/delete/{entity}', name: 'admin_user_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/user/resetting_request/{entity}", name="admin_user_resetting_request", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/admin/user/resetting_request/{entity}', name: 'admin_user_resetting_request', methods: ['POST'])]
|
||||
public function requestResetting(Entity $entity, EventDispatcherInterface $eventDispatcher, Request $request): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('resetting_request'.$entity->getId(), $request->request->get('_token'))) {
|
||||
|
|
|
@ -7,38 +7,26 @@ use App\Repository\Entity\Analytic\NodeViewRepository;
|
|||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=ViewRepository::class)
|
||||
* @ORM\Table(name="analytic_referer")
|
||||
*/
|
||||
#[ORM\Table(name: 'analytic_referer')]
|
||||
#[ORM\Entity(repositoryClass: ViewRepository::class)]
|
||||
class Referer implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Node::class, inversedBy="analyticReferers")
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Node::class, inversedBy: 'analyticReferers')]
|
||||
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
||||
protected $node;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $uri;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'integer', options: ['default' => 0])]
|
||||
protected $views = 0;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date")
|
||||
*/
|
||||
#[ORM\Column(type: 'date')]
|
||||
protected $date;
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
|
@ -7,48 +7,32 @@ use App\Repository\Entity\Analytic\NodeViewRepository;
|
|||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=ViewRepository::class)
|
||||
* @ORM\Table(name="analytic_view")
|
||||
*/
|
||||
#[ORM\Table(name: 'analytic_view')]
|
||||
#[ORM\Entity(repositoryClass: ViewRepository::class)]
|
||||
class View implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Node::class, inversedBy="analyticViews")
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Node::class, inversedBy: 'analyticViews')]
|
||||
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
||||
protected $node;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $path;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'integer', options: ['default' => 0])]
|
||||
protected $views = 0;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'integer', options: ['default' => 0])]
|
||||
protected $desktopViews = 0;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'integer', options: ['default' => 0])]
|
||||
protected $mobileViews = 0;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date")
|
||||
*/
|
||||
#[ORM\Column(type: 'date')]
|
||||
protected $date;
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
|
@ -5,21 +5,15 @@ namespace App\Core\Entity;
|
|||
use App\Repository\Entity\FileInformationRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=FileInformationRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: FileInformationRepository::class)]
|
||||
class FileInformation implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="NONE")
|
||||
* @ORM\Column(type="string", length=96, unique=true)
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'NONE')]
|
||||
#[ORM\Column(type: 'string', length: 96, unique: true)]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
protected $attributes;
|
||||
|
||||
public function getId(): ?string
|
||||
|
|
|
@ -6,42 +6,28 @@ use App\Core\Entity\Site\Navigation;
|
|||
use App\Core\Repository\NavigationSettingRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=NavigationSettingRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: NavigationSettingRepository::class)]
|
||||
class NavigationSetting implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $section;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Navigation::class, inversedBy="navigationSettings")
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Navigation::class, inversedBy: 'navigationSettings')]
|
||||
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
||||
protected $navigation;
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
|
@ -5,71 +5,45 @@ namespace App\Core\Entity;
|
|||
use App\Core\Repository\RedirectRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=RedirectRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: RedirectRepository::class)]
|
||||
class Redirect implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=5)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 5)]
|
||||
protected $scheme;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $domain;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=6)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 6)]
|
||||
protected $domainType;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $rule;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=6)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 6)]
|
||||
protected $ruleType;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $location;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $redirectCode;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'integer', nullable: true)]
|
||||
protected $sortOrder;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[ORM\Column(type: 'boolean')]
|
||||
protected $isEnabled;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[ORM\Column(type: 'boolean')]
|
||||
protected $reuseQueryString;
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
|
@ -5,36 +5,24 @@ namespace App\Core\Entity;
|
|||
use App\Core\Repository\SettingRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=SettingRepository::class)
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: SettingRepository::class)]
|
||||
class Setting implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $section;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
protected $value;
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
|
@ -9,46 +9,32 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=MenuRepository::class)
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: MenuRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Menu implements EntityInterface
|
||||
{
|
||||
use Timestampable;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Navigation::class, inversedBy="menus")
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Navigation::class, inversedBy: 'menus')]
|
||||
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
||||
protected $navigation;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Node::class, mappedBy="menu", orphanRemoval=true, cascade={"remove", "persist"})
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Node::class, mappedBy: 'menu', orphanRemoval: true, cascade: ['remove', 'persist'])]
|
||||
protected $nodes;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity=Node::class, cascade={"persist"})
|
||||
* @ORM\JoinColumn(onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\OneToOne(targetEntity: Node::class, cascade: ['persist'])]
|
||||
#[ORM\JoinColumn(onDelete: 'CASCADE')]
|
||||
protected $rootNode;
|
||||
|
||||
public function __construct()
|
||||
|
|
|
@ -10,64 +10,42 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=NavigationRepository::class)
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: NavigationRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Navigation implements EntityInterface
|
||||
{
|
||||
use Timestampable;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $domain;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
|
||||
protected $forceDomain = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
protected $additionalDomains = '[]';
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Menu::class, mappedBy="navigation")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Menu::class, mappedBy: 'navigation')]
|
||||
protected $menus;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=10)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 10)]
|
||||
protected $locale = 'en';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'integer', nullable: true)]
|
||||
protected $sortOrder;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=NavigationSetting::class, mappedBy="navigation", orphanRemoval=true)
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: NavigationSetting::class, mappedBy: 'navigation', orphanRemoval: true)]
|
||||
protected $navigationSettings;
|
||||
|
||||
public function __construct()
|
||||
|
|
|
@ -16,164 +16,118 @@ use function Symfony\Component\String\u;
|
|||
|
||||
/**
|
||||
* @Gedmo\Tree(type="nested")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
* @ORM\Entity(repositoryClass=NodeRepository::class)
|
||||
*/
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Entity(repositoryClass: NodeRepository::class)]
|
||||
class Node implements EntityInterface
|
||||
{
|
||||
use Timestampable;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Menu::class, inversedBy="nodes", cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Menu::class, inversedBy: 'nodes', cascade: ['persist', 'remove'])]
|
||||
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
||||
protected $menu;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $url;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
|
||||
protected $disableUrl = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
|
||||
protected $isVisible = false;
|
||||
|
||||
/**
|
||||
* @Gedmo\TreeLeft
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $treeLeft;
|
||||
|
||||
/**
|
||||
* @Gedmo\TreeLevel
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $treeLevel;
|
||||
|
||||
/**
|
||||
* @Gedmo\TreeRight
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $treeRight;
|
||||
|
||||
/**
|
||||
* @Gedmo\TreeRoot
|
||||
* @ORM\ManyToOne(targetEntity="Node")
|
||||
* @ORM\JoinColumn(referencedColumnName="id", onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: 'Node')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'id', onDelete: 'CASCADE')]
|
||||
protected $treeRoot;
|
||||
|
||||
/**
|
||||
* @Gedmo\TreeParent
|
||||
* @ORM\ManyToOne(targetEntity="Node", inversedBy="children")
|
||||
* @ORM\JoinColumn(referencedColumnName="id", onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: 'Node', inversedBy: 'children')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'id', onDelete: 'CASCADE')]
|
||||
protected $parent;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Node", mappedBy="parent")
|
||||
* @ORM\OrderBy({"treeLeft"="ASC"})
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: 'Node', mappedBy: 'parent')]
|
||||
#[ORM\OrderBy(['treeLeft' => 'ASC'])]
|
||||
protected $children;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Page::class, inversedBy="nodes", cascade={"persist"})
|
||||
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Page::class, inversedBy: 'nodes', cascade: ['persist'])]
|
||||
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
|
||||
protected $page;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $code;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="array", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'array', nullable: true)]
|
||||
protected $parameters = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="array", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'array', nullable: true)]
|
||||
protected $attributes = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $controller;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="array", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'array', nullable: true)]
|
||||
protected $sitemapParameters = [];
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Node::class, inversedBy="aliasNodes")
|
||||
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Node::class, inversedBy: 'aliasNodes')]
|
||||
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
|
||||
protected $aliasNode;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Node::class, mappedBy="aliasNode")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Node::class, mappedBy: 'aliasNode')]
|
||||
protected $aliasNodes;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $contentType;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
|
||||
protected $enableAnalytics = false;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=View::class, mappedBy="node")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: View::class, mappedBy: 'node')]
|
||||
protected $analyticViews;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Referer::class, mappedBy="node")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Referer::class, mappedBy: 'node')]
|
||||
protected $analyticReferers;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="array", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'array', nullable: true)]
|
||||
private $securityRoles = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=3, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 3, nullable: true)]
|
||||
private $securityOperator = 'or';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default"=0})
|
||||
*/
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
|
||||
private $hasAbTest = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $abTestCode;
|
||||
|
||||
public function __construct()
|
||||
|
|
|
@ -6,37 +6,27 @@ use App\Core\Doctrine\Timestampable;
|
|||
use App\Core\Repository\Site\Page\BlockRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=BlockRepository::class)
|
||||
* @ORM\DiscriminatorColumn(name="class_key", type="string")
|
||||
* @ORM\InheritanceType("SINGLE_TABLE")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: BlockRepository::class)]
|
||||
#[ORM\DiscriminatorColumn(name: 'class_key', type: 'string')]
|
||||
#[ORM\InheritanceType('SINGLE_TABLE')]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Block
|
||||
{
|
||||
use Timestampable;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Page::class, inversedBy="blocks")
|
||||
* @ORM\JoinColumn(onDelete="CASCADE")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Page::class, inversedBy: 'blocks')]
|
||||
#[ORM\JoinColumn(onDelete: 'CASCADE')]
|
||||
protected $page;
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
|
@ -4,9 +4,7 @@ namespace App\Core\Entity\Site\Page;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
class ChoiceBlock extends Block
|
||||
{
|
||||
public function getValue()
|
||||
|
|
|
@ -4,9 +4,7 @@ namespace App\Core\Entity\Site\Page;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
class CollectionBlock extends Block
|
||||
{
|
||||
public function getValue()
|
||||
|
|
|
@ -6,9 +6,7 @@ use App\Core\File\FileAttribute;
|
|||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
class FileBlock extends Block
|
||||
{
|
||||
public function getValue()
|
||||
|
|
|
@ -13,66 +13,44 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||
use Symfony\Component\HttpFoundation\File\File;
|
||||
use App\Core\File\FileAttribute;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=PageRepository::class)
|
||||
* @ORM\DiscriminatorColumn(name="class_key", type="string")
|
||||
* @ORM\InheritanceType("SINGLE_TABLE")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: PageRepository::class)]
|
||||
#[ORM\DiscriminatorColumn(name: 'class_key', type: 'string')]
|
||||
#[ORM\InheritanceType('SINGLE_TABLE')]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Page implements EntityInterface
|
||||
{
|
||||
use Timestampable;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $template;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Block::class, mappedBy="page", cascade={"persist"})
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Block::class, mappedBy: 'page', cascade: ['persist'])]
|
||||
protected $blocks;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $metaTitle;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $metaDescription;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $ogTitle;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $ogDescription;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
protected $ogImage;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Node::class, mappedBy="page")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Node::class, mappedBy: 'page')]
|
||||
protected $nodes;
|
||||
|
||||
public function __construct()
|
||||
|
|
|
@ -4,9 +4,7 @@ namespace App\Core\Entity\Site\Page;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
class TextBlock extends Block
|
||||
{
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ abstract class RepositoryQuery
|
|||
protected QueryBuilder $query;
|
||||
protected PaginatorInterface $paginator;
|
||||
protected string $id;
|
||||
protected array $forcedFilterHandlers;
|
||||
protected array $forcedFilterHandlers = [];
|
||||
|
||||
public function __construct(ServiceEntityRepository $repository, string $id, PaginatorInterface $paginator = null)
|
||||
{
|
||||
|
@ -25,7 +25,6 @@ abstract class RepositoryQuery
|
|||
$this->query = $repository->createQueryBuilder($id);
|
||||
$this->paginator = $paginator;
|
||||
$this->id = $id;
|
||||
$this->forcedFilterHandlers = [];
|
||||
}
|
||||
|
||||
public function __call(string $name, $params): self
|
||||
|
|
Loading…
Reference in a new issue