4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
23 use Civi\Api4\Generic\BasicGetFieldsAction
;
25 class Route
extends \Civi\Api4\Generic\AbstractEntity
{
28 * @return \Civi\Api4\Generic\BasicGetAction
30 public static function get() {
31 return new \Civi\Api4\Generic\
BasicGetAction(__CLASS__
, __FUNCTION__
, function ($get) {
32 // Pulling from ::items() rather than DB -- because it provides the final/live/altered data.
33 $items = \CRM_Core_Menu
::items();
35 foreach ($items as $path => $item) {
36 $result[] = ['path' => $path] +
$item;
42 public static function getFields() {
43 return new BasicGetFieldsAction(__CLASS__
, __FUNCTION__
, function() {
47 'title' => 'Relative Path',
49 'data_type' => 'String',
53 'title' => 'Page Title',
55 'data_type' => 'String',
58 'name' => 'page_callback',
59 'title' => 'Page Callback',
61 'data_type' => 'String',
64 'name' => 'page_arguments',
65 'title' => 'Page Arguments',
67 'data_type' => 'String',
70 'name' => 'path_arguments',
71 'title' => 'Path Arguments',
73 'data_type' => 'String',
76 'name' => 'access_arguments',
77 'title' => 'Access Arguments',
79 'data_type' => 'Array',
88 public static function permissions() {
90 "meta" => ["access CiviCRM"],
91 "default" => ["administer CiviCRM"],