<?php
-
/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
- */
-
namespace Civi\Api4;
/**
* Note: this is a read-only api as routes are set via xml files and hooks.
*
* @see https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterMenu/
- * @searchable false
+ * @searchable none
+ * @since 5.19
* @package Civi\Api4
*/
class Route extends \Civi\Api4\Generic\AbstractEntity {
/**
* @param bool $checkPermissions
- * @return \Civi\Api4\Generic\BasicGetAction
+ * @return Generic\BasicGetAction
*/
public static function get($checkPermissions = TRUE) {
- return (new \Civi\Api4\Generic\BasicGetAction(__CLASS__, __FUNCTION__, function ($get) {
- // Pulling from ::items() rather than DB -- because it provides the final/live/altered data.
- $items = \CRM_Core_Menu::items();
+ return (new Generic\BasicGetAction(__CLASS__, __FUNCTION__, function ($get) {
$result = [];
- foreach ($items as $path => $item) {
+ // Pulling from ::items() rather than DB -- because it provides the final/live/altered data.
+ foreach (\CRM_Core_Menu::items() as $path => $item) {
$result[] = ['path' => $path] + $item;
}
return $result;
[
'name' => 'path',
'title' => 'Relative Path',
- 'required' => TRUE,
'data_type' => 'String',
],
[
'name' => 'title',
'title' => 'Page Title',
- 'required' => TRUE,
'data_type' => 'String',
],
[
'name' => 'page_callback',
'title' => 'Page Callback',
- 'required' => TRUE,
'data_type' => 'String',
],
[
'name' => 'page_arguments',
'title' => 'Page Arguments',
- 'required' => FALSE,
'data_type' => 'String',
],
[
'name' => 'path_arguments',
'title' => 'Path Arguments',
- 'required' => FALSE,
'data_type' => 'String',
],
[
'name' => 'access_arguments',
'title' => 'Access Arguments',
- 'required' => FALSE,
'data_type' => 'Array',
],
];