@@ -17,42 +17,42 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class EspressoCoreAppAssetManager extends ReactAssetManager |
| 19 | 19 | { |
| 20 | - const JS_HANDLE_EDITOR = 'eventespresso-core-app'; |
|
| 20 | + const JS_HANDLE_EDITOR = 'eventespresso-core-app'; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @throws InvalidDataTypeException |
|
| 24 | - * @throws InvalidEntityException |
|
| 25 | - * @throws DuplicateCollectionIdentifierException |
|
| 26 | - * @throws DomainException |
|
| 27 | - */ |
|
| 28 | - public function addAssets() |
|
| 29 | - { |
|
| 30 | - parent::addAssets(); |
|
| 31 | - $this->registerJavascript(); |
|
| 32 | - } |
|
| 22 | + /** |
|
| 23 | + * @throws InvalidDataTypeException |
|
| 24 | + * @throws InvalidEntityException |
|
| 25 | + * @throws DuplicateCollectionIdentifierException |
|
| 26 | + * @throws DomainException |
|
| 27 | + */ |
|
| 28 | + public function addAssets() |
|
| 29 | + { |
|
| 30 | + parent::addAssets(); |
|
| 31 | + $this->registerJavascript(); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Register javascript assets |
|
| 37 | - * |
|
| 38 | - * @throws InvalidDataTypeException |
|
| 39 | - * @throws InvalidEntityException |
|
| 40 | - * @throws DuplicateCollectionIdentifierException |
|
| 41 | - * @throws DomainException |
|
| 42 | - */ |
|
| 43 | - private function registerJavascript() |
|
| 44 | - { |
|
| 45 | - $this->addJs( |
|
| 46 | - EspressoCoreAppAssetManager::JS_HANDLE_EDITOR, |
|
| 47 | - [ |
|
| 48 | - ReactAssetManager::JS_HANDLE_REACT, |
|
| 49 | - ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
| 50 | - CoreAssetManager::JS_HANDLE_JS_CORE, |
|
| 51 | - 'wp-components', |
|
| 52 | - 'wp-i18n', |
|
| 53 | - 'wp-keycodes', |
|
| 54 | - 'wp-url', |
|
| 55 | - ] |
|
| 56 | - )->setRequiresTranslation(); |
|
| 57 | - } |
|
| 35 | + /** |
|
| 36 | + * Register javascript assets |
|
| 37 | + * |
|
| 38 | + * @throws InvalidDataTypeException |
|
| 39 | + * @throws InvalidEntityException |
|
| 40 | + * @throws DuplicateCollectionIdentifierException |
|
| 41 | + * @throws DomainException |
|
| 42 | + */ |
|
| 43 | + private function registerJavascript() |
|
| 44 | + { |
|
| 45 | + $this->addJs( |
|
| 46 | + EspressoCoreAppAssetManager::JS_HANDLE_EDITOR, |
|
| 47 | + [ |
|
| 48 | + ReactAssetManager::JS_HANDLE_REACT, |
|
| 49 | + ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
| 50 | + CoreAssetManager::JS_HANDLE_JS_CORE, |
|
| 51 | + 'wp-components', |
|
| 52 | + 'wp-i18n', |
|
| 53 | + 'wp-keycodes', |
|
| 54 | + 'wp-url', |
|
| 55 | + ] |
|
| 56 | + )->setRequiresTranslation(); |
|
| 57 | + } |
|
| 58 | 58 | } |
@@ -20,49 +20,49 @@ |
||
| 20 | 20 | class EventEditor extends JsonDataNode |
| 21 | 21 | { |
| 22 | 22 | |
| 23 | - const NODE_NAME = 'eventEditor'; |
|
| 23 | + const NODE_NAME = 'eventEditor'; |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @var EventEditorGraphQLData |
|
| 28 | - */ |
|
| 29 | - protected $event_editor_gql_data; |
|
| 26 | + /** |
|
| 27 | + * @var EventEditorGraphQLData |
|
| 28 | + */ |
|
| 29 | + protected $event_editor_gql_data; |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * EventEditor JsonDataNode constructor. |
|
| 34 | - * |
|
| 35 | - * @param EventEditorGraphQLData $event_editor_gql_data |
|
| 36 | - * @param JsonDataNodeValidator $validator |
|
| 37 | - */ |
|
| 38 | - public function __construct( |
|
| 39 | - EventEditorGraphQLData $event_editor_gql_data, |
|
| 40 | - JsonDataNodeValidator $validator |
|
| 41 | - ) { |
|
| 42 | - parent::__construct($validator); |
|
| 43 | - $this->event_editor_gql_data = $event_editor_gql_data; |
|
| 44 | - $this->setDomain(EventEditor::NODE_NAME); |
|
| 45 | - $this->setNodeName(EventEditor::NODE_NAME); |
|
| 46 | - } |
|
| 32 | + /** |
|
| 33 | + * EventEditor JsonDataNode constructor. |
|
| 34 | + * |
|
| 35 | + * @param EventEditorGraphQLData $event_editor_gql_data |
|
| 36 | + * @param JsonDataNodeValidator $validator |
|
| 37 | + */ |
|
| 38 | + public function __construct( |
|
| 39 | + EventEditorGraphQLData $event_editor_gql_data, |
|
| 40 | + JsonDataNodeValidator $validator |
|
| 41 | + ) { |
|
| 42 | + parent::__construct($validator); |
|
| 43 | + $this->event_editor_gql_data = $event_editor_gql_data; |
|
| 44 | + $this->setDomain(EventEditor::NODE_NAME); |
|
| 45 | + $this->setNodeName(EventEditor::NODE_NAME); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @throws EE_Error |
|
| 51 | - * @throws ReflectionException |
|
| 52 | - * @since $VID:$ |
|
| 53 | - */ |
|
| 54 | - public function initialize() |
|
| 55 | - { |
|
| 56 | - global $post; |
|
| 57 | - $eventId = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : 0; |
|
| 58 | - // if there's no event ID but there IS a WP Post... then use the Post ID |
|
| 59 | - $use_post_id = $eventId === 0 && $post instanceof WP_Post && $post->post_type === 'espresso_events'; |
|
| 60 | - $eventId = $use_post_id ? $post->ID : $eventId; |
|
| 61 | - $event = ['dbId' => $eventId]; |
|
| 62 | - $this->addData('event', $event); |
|
| 63 | - $related_data = $this->event_editor_gql_data->getData($eventId); |
|
| 64 | - foreach ($related_data as $key => $value) { |
|
| 65 | - $this->addData($key, $value); |
|
| 66 | - } |
|
| 67 | - } |
|
| 49 | + /** |
|
| 50 | + * @throws EE_Error |
|
| 51 | + * @throws ReflectionException |
|
| 52 | + * @since $VID:$ |
|
| 53 | + */ |
|
| 54 | + public function initialize() |
|
| 55 | + { |
|
| 56 | + global $post; |
|
| 57 | + $eventId = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : 0; |
|
| 58 | + // if there's no event ID but there IS a WP Post... then use the Post ID |
|
| 59 | + $use_post_id = $eventId === 0 && $post instanceof WP_Post && $post->post_type === 'espresso_events'; |
|
| 60 | + $eventId = $use_post_id ? $post->ID : $eventId; |
|
| 61 | + $event = ['dbId' => $eventId]; |
|
| 62 | + $this->addData('event', $event); |
|
| 63 | + $related_data = $this->event_editor_gql_data->getData($eventId); |
|
| 64 | + foreach ($related_data as $key => $value) { |
|
| 65 | + $this->addData($key, $value); |
|
| 66 | + } |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -172,8 +172,8 @@ |
||
| 172 | 172 | */ |
| 173 | 173 | protected function requestHandler() |
| 174 | 174 | { |
| 175 | - if (! class_exists('WPGraphQL')) { |
|
| 176 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
| 175 | + if ( ! class_exists('WPGraphQL')) { |
|
| 176 | + require_once EE_THIRD_PARTY.'wp-graphql/wp-graphql.php'; |
|
| 177 | 177 | } |
| 178 | 178 | // load handler for EE GraphQL requests |
| 179 | 179 | $graphQL_manager = $this->loader->getShared( |
@@ -16,181 +16,181 @@ |
||
| 16 | 16 | class GQLRequests extends Route |
| 17 | 17 | { |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * returns true if the current request matches this route |
|
| 21 | - * |
|
| 22 | - * @return bool |
|
| 23 | - * @since $VID:$ |
|
| 24 | - */ |
|
| 25 | - public function matchesCurrentRequest() |
|
| 26 | - { |
|
| 27 | - global $pagenow; |
|
| 28 | - return PHP_VERSION_ID > 70000 |
|
| 29 | - && ( |
|
| 30 | - $this->request->isGQL() |
|
| 31 | - || $this->request->isUnitTesting() |
|
| 32 | - || ( |
|
| 33 | - $this->request->isAdmin() |
|
| 34 | - && $this->request->getRequestParam('page') === 'espresso_events' |
|
| 35 | - && ( |
|
| 36 | - $this->request->getRequestParam('action') === 'create_new' |
|
| 37 | - || $this->request->getRequestParam('action') === 'edit' |
|
| 38 | - ) |
|
| 39 | - ) |
|
| 40 | - || ( |
|
| 41 | - $pagenow |
|
| 42 | - && ( |
|
| 43 | - $pagenow === 'post-new.php' |
|
| 44 | - || ( |
|
| 45 | - $pagenow === 'post.php' |
|
| 46 | - && $this->request->getRequestParam('action') === 'edit' |
|
| 47 | - ) |
|
| 48 | - ) |
|
| 49 | - ) |
|
| 50 | - ); |
|
| 51 | - } |
|
| 19 | + /** |
|
| 20 | + * returns true if the current request matches this route |
|
| 21 | + * |
|
| 22 | + * @return bool |
|
| 23 | + * @since $VID:$ |
|
| 24 | + */ |
|
| 25 | + public function matchesCurrentRequest() |
|
| 26 | + { |
|
| 27 | + global $pagenow; |
|
| 28 | + return PHP_VERSION_ID > 70000 |
|
| 29 | + && ( |
|
| 30 | + $this->request->isGQL() |
|
| 31 | + || $this->request->isUnitTesting() |
|
| 32 | + || ( |
|
| 33 | + $this->request->isAdmin() |
|
| 34 | + && $this->request->getRequestParam('page') === 'espresso_events' |
|
| 35 | + && ( |
|
| 36 | + $this->request->getRequestParam('action') === 'create_new' |
|
| 37 | + || $this->request->getRequestParam('action') === 'edit' |
|
| 38 | + ) |
|
| 39 | + ) |
|
| 40 | + || ( |
|
| 41 | + $pagenow |
|
| 42 | + && ( |
|
| 43 | + $pagenow === 'post-new.php' |
|
| 44 | + || ( |
|
| 45 | + $pagenow === 'post.php' |
|
| 46 | + && $this->request->getRequestParam('action') === 'edit' |
|
| 47 | + ) |
|
| 48 | + ) |
|
| 49 | + ) |
|
| 50 | + ); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @since $VID:$ |
|
| 56 | - */ |
|
| 57 | - protected function registerDependencies() |
|
| 58 | - { |
|
| 59 | - $this->dependency_map->registerDependencies( |
|
| 60 | - 'EventEspresso\core\services\graphql\GraphQLManager', |
|
| 61 | - [ |
|
| 62 | - 'EventEspresso\core\services\graphql\ConnectionsManager' => EE_Dependency_Map::load_from_cache, |
|
| 63 | - 'EventEspresso\core\services\graphql\DataLoaderManager' => EE_Dependency_Map::load_from_cache, |
|
| 64 | - 'EventEspresso\core\services\graphql\EnumsManager' => EE_Dependency_Map::load_from_cache, |
|
| 65 | - 'EventEspresso\core\services\graphql\InputsManager' => EE_Dependency_Map::load_from_cache, |
|
| 66 | - 'EventEspresso\core\services\graphql\TypesManager' => EE_Dependency_Map::load_from_cache, |
|
| 67 | - ] |
|
| 68 | - ); |
|
| 69 | - $this->dependency_map->registerDependencies( |
|
| 70 | - 'EventEspresso\core\services\graphql\TypesManager', |
|
| 71 | - [ |
|
| 72 | - 'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache, |
|
| 73 | - ] |
|
| 74 | - ); |
|
| 75 | - $this->dependency_map->registerDependencies( |
|
| 76 | - 'EventEspresso\core\services\graphql\InputsManager', |
|
| 77 | - [ |
|
| 78 | - 'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache, |
|
| 79 | - ] |
|
| 80 | - ); |
|
| 81 | - $this->dependency_map->registerDependencies( |
|
| 82 | - 'EventEspresso\core\services\graphql\EnumsManager', |
|
| 83 | - [ |
|
| 84 | - 'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache, |
|
| 85 | - ] |
|
| 86 | - ); |
|
| 87 | - $this->dependency_map->registerDependencies( |
|
| 88 | - 'EventEspresso\core\services\graphql\ConnectionsManager', |
|
| 89 | - [ |
|
| 90 | - 'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache, |
|
| 91 | - ] |
|
| 92 | - ); |
|
| 93 | - $this->dependency_map->registerDependencies( |
|
| 94 | - 'EventEspresso\core\services\graphql\DataLoaderManager', |
|
| 95 | - [ |
|
| 96 | - 'EventEspresso\core\services\graphql\loaders\DataLoaderCollection' => EE_Dependency_Map::load_from_cache, |
|
| 97 | - ] |
|
| 98 | - ); |
|
| 99 | - $this->dependency_map->registerDependencies( |
|
| 100 | - 'EventEspresso\core\domain\services\graphql\types\Datetime', |
|
| 101 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 102 | - ); |
|
| 103 | - $this->dependency_map->registerDependencies( |
|
| 104 | - 'EventEspresso\core\domain\services\graphql\types\Attendee', |
|
| 105 | - ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
| 106 | - ); |
|
| 107 | - $this->dependency_map->registerDependencies( |
|
| 108 | - 'EventEspresso\core\domain\services\graphql\types\Event', |
|
| 109 | - ['EEM_Event' => EE_Dependency_Map::load_from_cache] |
|
| 110 | - ); |
|
| 111 | - $this->dependency_map->registerDependencies( |
|
| 112 | - 'EventEspresso\core\domain\services\graphql\types\Ticket', |
|
| 113 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
| 114 | - ); |
|
| 115 | - $this->dependency_map->registerDependencies( |
|
| 116 | - 'EventEspresso\core\domain\services\graphql\types\Price', |
|
| 117 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
| 118 | - ); |
|
| 119 | - $this->dependency_map->registerDependencies( |
|
| 120 | - 'EventEspresso\core\domain\services\graphql\types\PriceType', |
|
| 121 | - ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
| 122 | - ); |
|
| 123 | - $this->dependency_map->registerDependencies( |
|
| 124 | - 'EventEspresso\core\domain\services\graphql\types\Venue', |
|
| 125 | - ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
| 126 | - ); |
|
| 127 | - $this->dependency_map->registerDependencies( |
|
| 128 | - 'EventEspresso\core\domain\services\graphql\types\State', |
|
| 129 | - ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
| 130 | - ); |
|
| 131 | - $this->dependency_map->registerDependencies( |
|
| 132 | - 'EventEspresso\core\domain\services\graphql\types\Country', |
|
| 133 | - ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
| 134 | - ); |
|
| 135 | - $this->dependency_map->registerDependencies( |
|
| 136 | - 'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection', |
|
| 137 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 138 | - ); |
|
| 139 | - $this->dependency_map->registerDependencies( |
|
| 140 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection', |
|
| 141 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 142 | - ); |
|
| 143 | - $this->dependency_map->registerDependencies( |
|
| 144 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryAttendeesConnection', |
|
| 145 | - ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
| 146 | - ); |
|
| 147 | - $this->dependency_map->registerDependencies( |
|
| 148 | - 'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection', |
|
| 149 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
| 150 | - ); |
|
| 151 | - $this->dependency_map->registerDependencies( |
|
| 152 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection', |
|
| 153 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
| 154 | - ); |
|
| 155 | - $this->dependency_map->registerDependencies( |
|
| 156 | - 'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection', |
|
| 157 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
| 158 | - ); |
|
| 159 | - $this->dependency_map->registerDependencies( |
|
| 160 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection', |
|
| 161 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
| 162 | - ); |
|
| 163 | - $this->dependency_map->registerDependencies( |
|
| 164 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection', |
|
| 165 | - ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
| 166 | - ); |
|
| 167 | - $this->dependency_map->registerDependencies( |
|
| 168 | - 'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection', |
|
| 169 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 170 | - ); |
|
| 171 | - $this->dependency_map->registerDependencies( |
|
| 172 | - 'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection', |
|
| 173 | - ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
| 174 | - ); |
|
| 175 | - } |
|
| 54 | + /** |
|
| 55 | + * @since $VID:$ |
|
| 56 | + */ |
|
| 57 | + protected function registerDependencies() |
|
| 58 | + { |
|
| 59 | + $this->dependency_map->registerDependencies( |
|
| 60 | + 'EventEspresso\core\services\graphql\GraphQLManager', |
|
| 61 | + [ |
|
| 62 | + 'EventEspresso\core\services\graphql\ConnectionsManager' => EE_Dependency_Map::load_from_cache, |
|
| 63 | + 'EventEspresso\core\services\graphql\DataLoaderManager' => EE_Dependency_Map::load_from_cache, |
|
| 64 | + 'EventEspresso\core\services\graphql\EnumsManager' => EE_Dependency_Map::load_from_cache, |
|
| 65 | + 'EventEspresso\core\services\graphql\InputsManager' => EE_Dependency_Map::load_from_cache, |
|
| 66 | + 'EventEspresso\core\services\graphql\TypesManager' => EE_Dependency_Map::load_from_cache, |
|
| 67 | + ] |
|
| 68 | + ); |
|
| 69 | + $this->dependency_map->registerDependencies( |
|
| 70 | + 'EventEspresso\core\services\graphql\TypesManager', |
|
| 71 | + [ |
|
| 72 | + 'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache, |
|
| 73 | + ] |
|
| 74 | + ); |
|
| 75 | + $this->dependency_map->registerDependencies( |
|
| 76 | + 'EventEspresso\core\services\graphql\InputsManager', |
|
| 77 | + [ |
|
| 78 | + 'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache, |
|
| 79 | + ] |
|
| 80 | + ); |
|
| 81 | + $this->dependency_map->registerDependencies( |
|
| 82 | + 'EventEspresso\core\services\graphql\EnumsManager', |
|
| 83 | + [ |
|
| 84 | + 'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache, |
|
| 85 | + ] |
|
| 86 | + ); |
|
| 87 | + $this->dependency_map->registerDependencies( |
|
| 88 | + 'EventEspresso\core\services\graphql\ConnectionsManager', |
|
| 89 | + [ |
|
| 90 | + 'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache, |
|
| 91 | + ] |
|
| 92 | + ); |
|
| 93 | + $this->dependency_map->registerDependencies( |
|
| 94 | + 'EventEspresso\core\services\graphql\DataLoaderManager', |
|
| 95 | + [ |
|
| 96 | + 'EventEspresso\core\services\graphql\loaders\DataLoaderCollection' => EE_Dependency_Map::load_from_cache, |
|
| 97 | + ] |
|
| 98 | + ); |
|
| 99 | + $this->dependency_map->registerDependencies( |
|
| 100 | + 'EventEspresso\core\domain\services\graphql\types\Datetime', |
|
| 101 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 102 | + ); |
|
| 103 | + $this->dependency_map->registerDependencies( |
|
| 104 | + 'EventEspresso\core\domain\services\graphql\types\Attendee', |
|
| 105 | + ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
| 106 | + ); |
|
| 107 | + $this->dependency_map->registerDependencies( |
|
| 108 | + 'EventEspresso\core\domain\services\graphql\types\Event', |
|
| 109 | + ['EEM_Event' => EE_Dependency_Map::load_from_cache] |
|
| 110 | + ); |
|
| 111 | + $this->dependency_map->registerDependencies( |
|
| 112 | + 'EventEspresso\core\domain\services\graphql\types\Ticket', |
|
| 113 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
| 114 | + ); |
|
| 115 | + $this->dependency_map->registerDependencies( |
|
| 116 | + 'EventEspresso\core\domain\services\graphql\types\Price', |
|
| 117 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
| 118 | + ); |
|
| 119 | + $this->dependency_map->registerDependencies( |
|
| 120 | + 'EventEspresso\core\domain\services\graphql\types\PriceType', |
|
| 121 | + ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
| 122 | + ); |
|
| 123 | + $this->dependency_map->registerDependencies( |
|
| 124 | + 'EventEspresso\core\domain\services\graphql\types\Venue', |
|
| 125 | + ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
| 126 | + ); |
|
| 127 | + $this->dependency_map->registerDependencies( |
|
| 128 | + 'EventEspresso\core\domain\services\graphql\types\State', |
|
| 129 | + ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
| 130 | + ); |
|
| 131 | + $this->dependency_map->registerDependencies( |
|
| 132 | + 'EventEspresso\core\domain\services\graphql\types\Country', |
|
| 133 | + ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
| 134 | + ); |
|
| 135 | + $this->dependency_map->registerDependencies( |
|
| 136 | + 'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection', |
|
| 137 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 138 | + ); |
|
| 139 | + $this->dependency_map->registerDependencies( |
|
| 140 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection', |
|
| 141 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 142 | + ); |
|
| 143 | + $this->dependency_map->registerDependencies( |
|
| 144 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryAttendeesConnection', |
|
| 145 | + ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
| 146 | + ); |
|
| 147 | + $this->dependency_map->registerDependencies( |
|
| 148 | + 'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection', |
|
| 149 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
| 150 | + ); |
|
| 151 | + $this->dependency_map->registerDependencies( |
|
| 152 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection', |
|
| 153 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
| 154 | + ); |
|
| 155 | + $this->dependency_map->registerDependencies( |
|
| 156 | + 'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection', |
|
| 157 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
| 158 | + ); |
|
| 159 | + $this->dependency_map->registerDependencies( |
|
| 160 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection', |
|
| 161 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
| 162 | + ); |
|
| 163 | + $this->dependency_map->registerDependencies( |
|
| 164 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection', |
|
| 165 | + ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
| 166 | + ); |
|
| 167 | + $this->dependency_map->registerDependencies( |
|
| 168 | + 'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection', |
|
| 169 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
| 170 | + ); |
|
| 171 | + $this->dependency_map->registerDependencies( |
|
| 172 | + 'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection', |
|
| 173 | + ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
| 174 | + ); |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | 177 | |
| 178 | - /** |
|
| 179 | - * implements logic required to run during request |
|
| 180 | - * |
|
| 181 | - * @return bool |
|
| 182 | - * @since $VID:$ |
|
| 183 | - */ |
|
| 184 | - protected function requestHandler() |
|
| 185 | - { |
|
| 186 | - if (! class_exists('WPGraphQL')) { |
|
| 187 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
| 188 | - } |
|
| 189 | - // load handler for EE GraphQL requests |
|
| 190 | - $graphQL_manager = $this->loader->getShared( |
|
| 191 | - 'EventEspresso\core\services\graphql\GraphQLManager' |
|
| 192 | - ); |
|
| 193 | - $graphQL_manager->init(); |
|
| 194 | - return true; |
|
| 195 | - } |
|
| 178 | + /** |
|
| 179 | + * implements logic required to run during request |
|
| 180 | + * |
|
| 181 | + * @return bool |
|
| 182 | + * @since $VID:$ |
|
| 183 | + */ |
|
| 184 | + protected function requestHandler() |
|
| 185 | + { |
|
| 186 | + if (! class_exists('WPGraphQL')) { |
|
| 187 | + require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
| 188 | + } |
|
| 189 | + // load handler for EE GraphQL requests |
|
| 190 | + $graphQL_manager = $this->loader->getShared( |
|
| 191 | + 'EventEspresso\core\services\graphql\GraphQLManager' |
|
| 192 | + ); |
|
| 193 | + $graphQL_manager->init(); |
|
| 194 | + return true; |
|
| 195 | + } |
|
| 196 | 196 | } |
@@ -13,15 +13,15 @@ discard block |
||
| 13 | 13 | class CurrentUser extends GraphQLData |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @param array $where_params |
|
| 18 | - * @return array|null |
|
| 19 | - * @since $VID:$ |
|
| 20 | - */ |
|
| 21 | - public function getData(array $where_params = []) |
|
| 22 | - { |
|
| 23 | - $field_key = 'viewer'; |
|
| 24 | - $query = <<<QUERY |
|
| 16 | + /** |
|
| 17 | + * @param array $where_params |
|
| 18 | + * @return array|null |
|
| 19 | + * @since $VID:$ |
|
| 20 | + */ |
|
| 21 | + public function getData(array $where_params = []) |
|
| 22 | + { |
|
| 23 | + $field_key = 'viewer'; |
|
| 24 | + $query = <<<QUERY |
|
| 25 | 25 | query GET_CURRENT_USER { |
| 26 | 26 | {$field_key} { |
| 27 | 27 | id |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | QUERY; |
| 42 | - $this->setParams([ |
|
| 43 | - 'operation_name' => 'GET_CURRENT_USER', |
|
| 44 | - 'query' => $query, |
|
| 45 | - ]); |
|
| 42 | + $this->setParams([ |
|
| 43 | + 'operation_name' => 'GET_CURRENT_USER', |
|
| 44 | + 'query' => $query, |
|
| 45 | + ]); |
|
| 46 | 46 | |
| 47 | - return $this->getQueryResponse($field_key, $where_params); |
|
| 48 | - } |
|
| 47 | + return $this->getQueryResponse($field_key, $where_params); |
|
| 48 | + } |
|
| 49 | 49 | } |
@@ -16,142 +16,142 @@ |
||
| 16 | 16 | class EspressoLegacyAdmin extends AdminRoute |
| 17 | 17 | { |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * @var LegacyAccountingAssetManager $asset_manager |
|
| 21 | - */ |
|
| 22 | - protected $asset_manager; |
|
| 19 | + /** |
|
| 20 | + * @var LegacyAccountingAssetManager $asset_manager |
|
| 21 | + */ |
|
| 22 | + protected $asset_manager; |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * returns true if the current request matches this route |
|
| 27 | - * |
|
| 28 | - * @return bool |
|
| 29 | - * @since $VID:$ |
|
| 30 | - */ |
|
| 31 | - public function matchesCurrentRequest() |
|
| 32 | - { |
|
| 33 | - global $pagenow; |
|
| 34 | - return $this->request->isAdminAjax() || ( |
|
| 35 | - parent::matchesCurrentRequest() && $pagenow && $pagenow === 'admin.php' |
|
| 36 | - ); |
|
| 37 | - } |
|
| 25 | + /** |
|
| 26 | + * returns true if the current request matches this route |
|
| 27 | + * |
|
| 28 | + * @return bool |
|
| 29 | + * @since $VID:$ |
|
| 30 | + */ |
|
| 31 | + public function matchesCurrentRequest() |
|
| 32 | + { |
|
| 33 | + global $pagenow; |
|
| 34 | + return $this->request->isAdminAjax() || ( |
|
| 35 | + parent::matchesCurrentRequest() && $pagenow && $pagenow === 'admin.php' |
|
| 36 | + ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @since $VID:$ |
|
| 42 | - */ |
|
| 43 | - protected function registerDependencies() |
|
| 44 | - { |
|
| 45 | - $this->dependency_map->registerDependencies( |
|
| 46 | - 'EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager', |
|
| 47 | - [ |
|
| 48 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 49 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
| 50 | - 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
| 51 | - ] |
|
| 52 | - ); |
|
| 53 | - $this->dependency_map->registerDependencies( |
|
| 54 | - 'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager', |
|
| 55 | - [ |
|
| 56 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 57 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
| 58 | - 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
| 59 | - 'EE_Currency_Config' => EE_Dependency_Map::load_from_cache, |
|
| 60 | - ] |
|
| 61 | - ); |
|
| 62 | - $this->dependency_map->registerDependencies( |
|
| 63 | - 'EE_Admin_Transactions_List_Table', |
|
| 64 | - [ |
|
| 65 | - null, |
|
| 66 | - 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
| 67 | - ] |
|
| 68 | - ); |
|
| 69 | - $this->dependency_map->registerDependencies( |
|
| 70 | - 'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings', |
|
| 71 | - ['EE_Registration_Config' => EE_Dependency_Map::load_from_cache] |
|
| 72 | - ); |
|
| 73 | - $this->dependency_map->registerDependencies( |
|
| 74 | - 'EventEspresso\admin_pages\general_settings\OrganizationSettings', |
|
| 75 | - [ |
|
| 76 | - 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 77 | - 'EE_Organization_Config' => EE_Dependency_Map::load_from_cache, |
|
| 78 | - 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 79 | - 'EE_Network_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 80 | - 'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache, |
|
| 81 | - ] |
|
| 82 | - ); |
|
| 83 | - $this->dependency_map->registerDependencies( |
|
| 84 | - 'EventEspresso\core\services\address\CountrySubRegionDao', |
|
| 85 | - [ |
|
| 86 | - 'EEM_State' => EE_Dependency_Map::load_from_cache, |
|
| 87 | - 'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache |
|
| 88 | - ] |
|
| 89 | - ); |
|
| 90 | - $this->dependency_map->registerDependencies( |
|
| 91 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder', |
|
| 92 | - [ |
|
| 93 | - null, |
|
| 94 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 95 | - 'EEM_Registration' => EE_Dependency_Map::load_from_cache, |
|
| 96 | - ] |
|
| 97 | - ); |
|
| 98 | - $this->dependency_map->registerDependencies( |
|
| 99 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader', |
|
| 100 | - [ |
|
| 101 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 102 | - 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
| 103 | - ] |
|
| 104 | - ); |
|
| 105 | - $this->dependency_map->registerDependencies( |
|
| 106 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader', |
|
| 107 | - [ |
|
| 108 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 109 | - 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
| 110 | - ] |
|
| 111 | - ); |
|
| 112 | - $this->dependency_map->registerDependencies( |
|
| 113 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader', |
|
| 114 | - [ |
|
| 115 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 116 | - 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
| 117 | - ] |
|
| 118 | - ); |
|
| 119 | - $this->dependency_map->registerDependencies( |
|
| 120 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader', |
|
| 121 | - [ |
|
| 122 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 123 | - 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
|
| 124 | - ] |
|
| 125 | - ); |
|
| 126 | - } |
|
| 40 | + /** |
|
| 41 | + * @since $VID:$ |
|
| 42 | + */ |
|
| 43 | + protected function registerDependencies() |
|
| 44 | + { |
|
| 45 | + $this->dependency_map->registerDependencies( |
|
| 46 | + 'EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager', |
|
| 47 | + [ |
|
| 48 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 49 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
| 50 | + 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
| 51 | + ] |
|
| 52 | + ); |
|
| 53 | + $this->dependency_map->registerDependencies( |
|
| 54 | + 'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager', |
|
| 55 | + [ |
|
| 56 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 57 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
| 58 | + 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
| 59 | + 'EE_Currency_Config' => EE_Dependency_Map::load_from_cache, |
|
| 60 | + ] |
|
| 61 | + ); |
|
| 62 | + $this->dependency_map->registerDependencies( |
|
| 63 | + 'EE_Admin_Transactions_List_Table', |
|
| 64 | + [ |
|
| 65 | + null, |
|
| 66 | + 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
| 67 | + ] |
|
| 68 | + ); |
|
| 69 | + $this->dependency_map->registerDependencies( |
|
| 70 | + 'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings', |
|
| 71 | + ['EE_Registration_Config' => EE_Dependency_Map::load_from_cache] |
|
| 72 | + ); |
|
| 73 | + $this->dependency_map->registerDependencies( |
|
| 74 | + 'EventEspresso\admin_pages\general_settings\OrganizationSettings', |
|
| 75 | + [ |
|
| 76 | + 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 77 | + 'EE_Organization_Config' => EE_Dependency_Map::load_from_cache, |
|
| 78 | + 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 79 | + 'EE_Network_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 80 | + 'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache, |
|
| 81 | + ] |
|
| 82 | + ); |
|
| 83 | + $this->dependency_map->registerDependencies( |
|
| 84 | + 'EventEspresso\core\services\address\CountrySubRegionDao', |
|
| 85 | + [ |
|
| 86 | + 'EEM_State' => EE_Dependency_Map::load_from_cache, |
|
| 87 | + 'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache |
|
| 88 | + ] |
|
| 89 | + ); |
|
| 90 | + $this->dependency_map->registerDependencies( |
|
| 91 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder', |
|
| 92 | + [ |
|
| 93 | + null, |
|
| 94 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 95 | + 'EEM_Registration' => EE_Dependency_Map::load_from_cache, |
|
| 96 | + ] |
|
| 97 | + ); |
|
| 98 | + $this->dependency_map->registerDependencies( |
|
| 99 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader', |
|
| 100 | + [ |
|
| 101 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 102 | + 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
| 103 | + ] |
|
| 104 | + ); |
|
| 105 | + $this->dependency_map->registerDependencies( |
|
| 106 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader', |
|
| 107 | + [ |
|
| 108 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 109 | + 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
| 110 | + ] |
|
| 111 | + ); |
|
| 112 | + $this->dependency_map->registerDependencies( |
|
| 113 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader', |
|
| 114 | + [ |
|
| 115 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 116 | + 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
| 117 | + ] |
|
| 118 | + ); |
|
| 119 | + $this->dependency_map->registerDependencies( |
|
| 120 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader', |
|
| 121 | + [ |
|
| 122 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 123 | + 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
|
| 124 | + ] |
|
| 125 | + ); |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | 128 | |
| 129 | - /** |
|
| 130 | - * implements logic required to run during request |
|
| 131 | - * |
|
| 132 | - * @return bool |
|
| 133 | - * @since $VID:$ |
|
| 134 | - */ |
|
| 135 | - protected function requestHandler() |
|
| 136 | - { |
|
| 137 | - do_action('AHEE__EE_System__load_controllers__load_admin_controllers'); |
|
| 138 | - $this->loader->getShared('EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager'); |
|
| 139 | - $this->asset_manager = $this->loader->getShared( |
|
| 140 | - 'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager' |
|
| 141 | - ); |
|
| 142 | - add_action('admin_enqueue_scripts', [$this, 'enqueueLegacyAccountingAssets'], 100); |
|
| 143 | - return true; |
|
| 144 | - } |
|
| 129 | + /** |
|
| 130 | + * implements logic required to run during request |
|
| 131 | + * |
|
| 132 | + * @return bool |
|
| 133 | + * @since $VID:$ |
|
| 134 | + */ |
|
| 135 | + protected function requestHandler() |
|
| 136 | + { |
|
| 137 | + do_action('AHEE__EE_System__load_controllers__load_admin_controllers'); |
|
| 138 | + $this->loader->getShared('EventEspresso\core\domain\services\assets\EspressoLegacyAdminAssetManager'); |
|
| 139 | + $this->asset_manager = $this->loader->getShared( |
|
| 140 | + 'EventEspresso\core\domain\services\assets\LegacyAccountingAssetManager' |
|
| 141 | + ); |
|
| 142 | + add_action('admin_enqueue_scripts', [$this, 'enqueueLegacyAccountingAssets'], 100); |
|
| 143 | + return true; |
|
| 144 | + } |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | - /** |
|
| 148 | - * enqueue_scripts - Load the scripts and css |
|
| 149 | - * |
|
| 150 | - * @return void |
|
| 151 | - */ |
|
| 152 | - public function enqueueLegacyAccountingAssets() |
|
| 153 | - { |
|
| 154 | - $this->asset_manager->enqueueBrowserAssets(); |
|
| 155 | - wp_enqueue_script('ee-accounting'); |
|
| 156 | - } |
|
| 147 | + /** |
|
| 148 | + * enqueue_scripts - Load the scripts and css |
|
| 149 | + * |
|
| 150 | + * @return void |
|
| 151 | + */ |
|
| 152 | + public function enqueueLegacyAccountingAssets() |
|
| 153 | + { |
|
| 154 | + $this->asset_manager->enqueueBrowserAssets(); |
|
| 155 | + wp_enqueue_script('ee-accounting'); |
|
| 156 | + } |
|
| 157 | 157 | } |
@@ -25,64 +25,64 @@ |
||
| 25 | 25 | class AdminRoute extends Route |
| 26 | 26 | { |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var EE_Admin_Config $admin_config |
|
| 30 | - */ |
|
| 31 | - protected $admin_config; |
|
| 28 | + /** |
|
| 29 | + * @var EE_Admin_Config $admin_config |
|
| 30 | + */ |
|
| 31 | + protected $admin_config; |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Route constructor. |
|
| 36 | - * |
|
| 37 | - * @param EE_Admin_Config $admin_config |
|
| 38 | - * @param EE_Dependency_Map $dependency_map |
|
| 39 | - * @param LoaderInterface $loader |
|
| 40 | - * @param RequestInterface $request |
|
| 41 | - * @param JsonDataNode $data_node |
|
| 42 | - * @param RouteMatchSpecificationInterface $specification |
|
| 43 | - */ |
|
| 44 | - public function __construct( |
|
| 45 | - EE_Admin_Config $admin_config, |
|
| 46 | - EE_Dependency_Map $dependency_map, |
|
| 47 | - LoaderInterface $loader, |
|
| 48 | - RequestInterface $request, |
|
| 49 | - JsonDataNode $data_node = null, |
|
| 50 | - RouteMatchSpecificationInterface $specification = null |
|
| 51 | - ) { |
|
| 52 | - $this->admin_config = $admin_config; |
|
| 53 | - parent::__construct($dependency_map, $loader, $request, $data_node, $specification); |
|
| 54 | - } |
|
| 34 | + /** |
|
| 35 | + * Route constructor. |
|
| 36 | + * |
|
| 37 | + * @param EE_Admin_Config $admin_config |
|
| 38 | + * @param EE_Dependency_Map $dependency_map |
|
| 39 | + * @param LoaderInterface $loader |
|
| 40 | + * @param RequestInterface $request |
|
| 41 | + * @param JsonDataNode $data_node |
|
| 42 | + * @param RouteMatchSpecificationInterface $specification |
|
| 43 | + */ |
|
| 44 | + public function __construct( |
|
| 45 | + EE_Admin_Config $admin_config, |
|
| 46 | + EE_Dependency_Map $dependency_map, |
|
| 47 | + LoaderInterface $loader, |
|
| 48 | + RequestInterface $request, |
|
| 49 | + JsonDataNode $data_node = null, |
|
| 50 | + RouteMatchSpecificationInterface $specification = null |
|
| 51 | + ) { |
|
| 52 | + $this->admin_config = $admin_config; |
|
| 53 | + parent::__construct($dependency_map, $loader, $request, $data_node, $specification); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * returns true if the current request matches this route |
|
| 59 | - * |
|
| 60 | - * @return bool |
|
| 61 | - * @since $VID:$ |
|
| 62 | - */ |
|
| 63 | - public function matchesCurrentRequest() |
|
| 64 | - { |
|
| 65 | - return $this->request->isAdmin(); |
|
| 66 | - } |
|
| 57 | + /** |
|
| 58 | + * returns true if the current request matches this route |
|
| 59 | + * |
|
| 60 | + * @return bool |
|
| 61 | + * @since $VID:$ |
|
| 62 | + */ |
|
| 63 | + public function matchesCurrentRequest() |
|
| 64 | + { |
|
| 65 | + return $this->request->isAdmin(); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * @since $VID:$ |
|
| 71 | - */ |
|
| 72 | - protected function registerDependencies() |
|
| 73 | - { |
|
| 74 | - } |
|
| 69 | + /** |
|
| 70 | + * @since $VID:$ |
|
| 71 | + */ |
|
| 72 | + protected function registerDependencies() |
|
| 73 | + { |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * implements logic required to run during request |
|
| 79 | - * |
|
| 80 | - * @return bool |
|
| 81 | - * @since $VID:$ |
|
| 82 | - */ |
|
| 83 | - protected function requestHandler() |
|
| 84 | - { |
|
| 85 | - $this->loader->getShared('EE_Admin'); |
|
| 86 | - return true; |
|
| 87 | - } |
|
| 77 | + /** |
|
| 78 | + * implements logic required to run during request |
|
| 79 | + * |
|
| 80 | + * @return bool |
|
| 81 | + * @since $VID:$ |
|
| 82 | + */ |
|
| 83 | + protected function requestHandler() |
|
| 84 | + { |
|
| 85 | + $this->loader->getShared('EE_Admin'); |
|
| 86 | + return true; |
|
| 87 | + } |
|
| 88 | 88 | } |
@@ -15,30 +15,30 @@ |
||
| 15 | 15 | class EspressoEventsAdmin extends AdminRoute |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * returns true if the current request matches this route |
|
| 20 | - * |
|
| 21 | - * @return bool |
|
| 22 | - * @since $VID:$ |
|
| 23 | - */ |
|
| 24 | - public function matchesCurrentRequest() |
|
| 25 | - { |
|
| 26 | - global $pagenow; |
|
| 27 | - return parent::matchesCurrentRequest() |
|
| 28 | - && $pagenow |
|
| 29 | - && $pagenow === 'admin.php' |
|
| 30 | - && $this->request->getRequestParam('page') === 'espresso_events'; |
|
| 31 | - } |
|
| 18 | + /** |
|
| 19 | + * returns true if the current request matches this route |
|
| 20 | + * |
|
| 21 | + * @return bool |
|
| 22 | + * @since $VID:$ |
|
| 23 | + */ |
|
| 24 | + public function matchesCurrentRequest() |
|
| 25 | + { |
|
| 26 | + global $pagenow; |
|
| 27 | + return parent::matchesCurrentRequest() |
|
| 28 | + && $pagenow |
|
| 29 | + && $pagenow === 'admin.php' |
|
| 30 | + && $this->request->getRequestParam('page') === 'espresso_events'; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @since $VID:$ |
|
| 36 | - */ |
|
| 37 | - protected function registerDependencies() |
|
| 38 | - { |
|
| 39 | - $this->dependency_map->registerDependencies( |
|
| 40 | - 'EventEspresso\core\domain\services\admin\events\default_settings\AdvancedEditorAdminFormSection', |
|
| 41 | - ['EE_Admin_Config' => EE_Dependency_Map::load_from_cache] |
|
| 42 | - ); |
|
| 43 | - } |
|
| 34 | + /** |
|
| 35 | + * @since $VID:$ |
|
| 36 | + */ |
|
| 37 | + protected function registerDependencies() |
|
| 38 | + { |
|
| 39 | + $this->dependency_map->registerDependencies( |
|
| 40 | + 'EventEspresso\core\domain\services\admin\events\default_settings\AdvancedEditorAdminFormSection', |
|
| 41 | + ['EE_Admin_Config' => EE_Dependency_Map::load_from_cache] |
|
| 42 | + ); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -16,45 +16,45 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class CurrentUser extends JsonDataNode |
| 18 | 18 | { |
| 19 | - const NODE_NAME = 'currentUser'; |
|
| 19 | + const NODE_NAME = 'currentUser'; |
|
| 20 | 20 | |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * JsonDataNodeHandler constructor. |
|
| 24 | - * |
|
| 25 | - * @param JsonDataNodeValidator $validator |
|
| 26 | - */ |
|
| 27 | - public function __construct(JsonDataNodeValidator $validator) |
|
| 28 | - { |
|
| 29 | - if (! class_exists('WPGraphQL')) { |
|
| 30 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
| 31 | - } |
|
| 32 | - parent::__construct($validator); |
|
| 33 | - $this->setNodeName(CurrentUser::NODE_NAME); |
|
| 34 | - } |
|
| 22 | + /** |
|
| 23 | + * JsonDataNodeHandler constructor. |
|
| 24 | + * |
|
| 25 | + * @param JsonDataNodeValidator $validator |
|
| 26 | + */ |
|
| 27 | + public function __construct(JsonDataNodeValidator $validator) |
|
| 28 | + { |
|
| 29 | + if (! class_exists('WPGraphQL')) { |
|
| 30 | + require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
| 31 | + } |
|
| 32 | + parent::__construct($validator); |
|
| 33 | + $this->setNodeName(CurrentUser::NODE_NAME); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @inheritDoc |
|
| 38 | - */ |
|
| 39 | - public function initialize() |
|
| 40 | - { |
|
| 41 | - $current_user = wp_get_current_user(); |
|
| 42 | - if (! $current_user instanceof WP_User) { |
|
| 43 | - $current_user = new WP_User(); |
|
| 44 | - } |
|
| 36 | + /** |
|
| 37 | + * @inheritDoc |
|
| 38 | + */ |
|
| 39 | + public function initialize() |
|
| 40 | + { |
|
| 41 | + $current_user = wp_get_current_user(); |
|
| 42 | + if (! $current_user instanceof WP_User) { |
|
| 43 | + $current_user = new WP_User(); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $this->addData('id', Relay::toGlobalId('user', $current_user->ID)); |
|
| 47 | - $this->addData('databaseId', $current_user->ID); |
|
| 48 | - $this->addData('description', $current_user->description); |
|
| 49 | - $this->addData('email', $current_user->user_email); |
|
| 50 | - $this->addData('firstName', $current_user->first_name); |
|
| 51 | - $this->addData('lastName', $current_user->last_name); |
|
| 52 | - $this->addData('locale', get_user_locale($current_user->ID)); |
|
| 53 | - $this->addData('name', $current_user->display_name); |
|
| 54 | - $this->addData('nicename', $current_user->user_nicename); |
|
| 55 | - $this->addData('nickname', $current_user->nickname); |
|
| 56 | - $this->addData('username', $current_user->user_login); |
|
| 57 | - $this->addData('__typename', 'User'); |
|
| 58 | - $this->setInitialized(true); |
|
| 59 | - } |
|
| 46 | + $this->addData('id', Relay::toGlobalId('user', $current_user->ID)); |
|
| 47 | + $this->addData('databaseId', $current_user->ID); |
|
| 48 | + $this->addData('description', $current_user->description); |
|
| 49 | + $this->addData('email', $current_user->user_email); |
|
| 50 | + $this->addData('firstName', $current_user->first_name); |
|
| 51 | + $this->addData('lastName', $current_user->last_name); |
|
| 52 | + $this->addData('locale', get_user_locale($current_user->ID)); |
|
| 53 | + $this->addData('name', $current_user->display_name); |
|
| 54 | + $this->addData('nicename', $current_user->user_nicename); |
|
| 55 | + $this->addData('nickname', $current_user->nickname); |
|
| 56 | + $this->addData('username', $current_user->user_login); |
|
| 57 | + $this->addData('__typename', 'User'); |
|
| 58 | + $this->setInitialized(true); |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct(JsonDataNodeValidator $validator) |
| 28 | 28 | { |
| 29 | - if (! class_exists('WPGraphQL')) { |
|
| 30 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
| 29 | + if ( ! class_exists('WPGraphQL')) { |
|
| 30 | + require_once EE_THIRD_PARTY.'wp-graphql/wp-graphql.php'; |
|
| 31 | 31 | } |
| 32 | 32 | parent::__construct($validator); |
| 33 | 33 | $this->setNodeName(CurrentUser::NODE_NAME); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function initialize() |
| 40 | 40 | { |
| 41 | 41 | $current_user = wp_get_current_user(); |
| 42 | - if (! $current_user instanceof WP_User) { |
|
| 42 | + if ( ! $current_user instanceof WP_User) { |
|
| 43 | 43 | $current_user = new WP_User(); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -21,51 +21,51 @@ |
||
| 21 | 21 | class EventEspressoData extends PrimaryJsonDataNode |
| 22 | 22 | { |
| 23 | 23 | |
| 24 | - const NODE_NAME = 'eventEspressoData'; |
|
| 24 | + const NODE_NAME = 'eventEspressoData'; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @var Api $api |
|
| 28 | - */ |
|
| 29 | - private $api; |
|
| 26 | + /** |
|
| 27 | + * @var Api $api |
|
| 28 | + */ |
|
| 29 | + private $api; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @var Config $config |
|
| 33 | - */ |
|
| 34 | - private $config; |
|
| 31 | + /** |
|
| 32 | + * @var Config $config |
|
| 33 | + */ |
|
| 34 | + private $config; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @var JedLocaleData $jed_locale |
|
| 38 | - */ |
|
| 39 | - private $jed_locale; |
|
| 36 | + /** |
|
| 37 | + * @var JedLocaleData $jed_locale |
|
| 38 | + */ |
|
| 39 | + private $jed_locale; |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * JsonDataNodeHandler constructor. |
|
| 44 | - * |
|
| 45 | - * @param Api $api |
|
| 46 | - * @param Config $config |
|
| 47 | - * @param JedLocaleData $jed_locale |
|
| 48 | - * @param JsonDataNodeValidator $validator |
|
| 49 | - */ |
|
| 50 | - public function __construct(Api $api, Config $config, JedLocaleData $jed_locale, JsonDataNodeValidator $validator) |
|
| 51 | - { |
|
| 52 | - parent::__construct($validator); |
|
| 53 | - $this->api = $api; |
|
| 54 | - $this->config = $config; |
|
| 55 | - $this->jed_locale = $jed_locale; |
|
| 56 | - $this->setNodeName(EventEspressoData::NODE_NAME); |
|
| 57 | - } |
|
| 42 | + /** |
|
| 43 | + * JsonDataNodeHandler constructor. |
|
| 44 | + * |
|
| 45 | + * @param Api $api |
|
| 46 | + * @param Config $config |
|
| 47 | + * @param JedLocaleData $jed_locale |
|
| 48 | + * @param JsonDataNodeValidator $validator |
|
| 49 | + */ |
|
| 50 | + public function __construct(Api $api, Config $config, JedLocaleData $jed_locale, JsonDataNodeValidator $validator) |
|
| 51 | + { |
|
| 52 | + parent::__construct($validator); |
|
| 53 | + $this->api = $api; |
|
| 54 | + $this->config = $config; |
|
| 55 | + $this->jed_locale = $jed_locale; |
|
| 56 | + $this->setNodeName(EventEspressoData::NODE_NAME); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @throws DomainException |
|
| 62 | - * @since $VID:$ |
|
| 63 | - */ |
|
| 64 | - public function initialize() |
|
| 65 | - { |
|
| 66 | - $this->addDataNode($this->api); |
|
| 67 | - $this->addDataNode($this->config); |
|
| 68 | - $this->addData('i18n', $this->jed_locale->getData('event_espresso')); |
|
| 69 | - $this->setInitialized(true); |
|
| 70 | - } |
|
| 60 | + /** |
|
| 61 | + * @throws DomainException |
|
| 62 | + * @since $VID:$ |
|
| 63 | + */ |
|
| 64 | + public function initialize() |
|
| 65 | + { |
|
| 66 | + $this->addDataNode($this->api); |
|
| 67 | + $this->addDataNode($this->config); |
|
| 68 | + $this->addData('i18n', $this->jed_locale->getData('event_espresso')); |
|
| 69 | + $this->setInitialized(true); |
|
| 70 | + } |
|
| 71 | 71 | } |