4 use Civi\Api4\Generic\BasicGetFieldsAction
;
6 class Route
extends \Civi\Api4\Generic\AbstractEntity
{
9 * @return \Civi\Api4\Generic\BasicGetAction
11 public static function get() {
12 return new \Civi\Api4\Generic\
BasicGetAction(__CLASS__
, __FUNCTION__
, function ($get) {
13 // Pulling from ::items() rather than DB -- because it provides the final/live/altered data.
14 $items = \CRM_Core_Menu
::items();
16 foreach ($items as $path => $item) {
17 $result[] = ['path' => $path] +
$item;
23 public static function getFields() {
24 return new BasicGetFieldsAction(__CLASS__
, __FUNCTION__
, function() {
28 'title' => 'Relative Path',
30 'data_type' => 'String',
34 'title' => 'Page Title',
36 'data_type' => 'String',
39 'name' => 'page_callback',
40 'title' => 'Page Callback',
42 'data_type' => 'String',
45 'name' => 'page_arguments',
46 'title' => 'Page Arguments',
48 'data_type' => 'String',
51 'name' => 'path_arguments',
52 'title' => 'Path Arguments',
54 'data_type' => 'String',
57 'name' => 'access_arguments',
58 'title' => 'Access Arguments',
60 'data_type' => 'Array',
69 public static function permissions() {
71 "meta" => ["access CiviCRM"],
72 "default" => ["administer CiviCRM"],