*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
- * $Id$
- *
*/
namespace Civi\Api4;
-use Civi\Api4\Generic\BasicGetFieldsAction;
-
/**
* CiviCRM menu route.
*
* 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
* @package Civi\Api4
*/
class Route extends \Civi\Api4\Generic\AbstractEntity {
/**
+ * @param bool $checkPermissions
* @return \Civi\Api4\Generic\BasicGetAction
*/
- public static function get() {
- return new \Civi\Api4\Generic\BasicGetAction(__CLASS__, __FUNCTION__, function ($get) {
+ 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();
$result = [];
$result[] = ['path' => $path] + $item;
}
return $result;
- });
+ }))->setCheckPermissions($checkPermissions);
}
- public static function getFields() {
- return new BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
+ /**
+ * @param bool $checkPermissions
+ * @return Generic\BasicGetFieldsAction
+ */
+ public static function getFields($checkPermissions = TRUE) {
+ return (new Generic\BasicGetFieldsAction(__CLASS__, __FUNCTION__, function() {
return [
[
'name' => 'path',
'data_type' => 'Array',
],
];
- });
+ }))->setCheckPermissions($checkPermissions);
}
/**