@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'fromType' => 'RootQuery', |
41 | - 'toType' => $this->namespace . 'FormElement', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormElements', |
|
41 | + 'toType' => $this->namespace.'FormElement', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace).'FormElements', |
|
43 | 43 | 'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection", |
44 | 44 | 'connectionArgs' => $this->get_connection_args(), |
45 | 45 | 'resolve' => [$this, 'resolveConnection'], |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ), |
79 | 79 | ], |
80 | 80 | 'status' => [ |
81 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
81 | + 'type' => ['list_of' => $this->namespace.'FormSectionStatusEnum'], |
|
82 | 82 | 'description' => esc_html__( |
83 | 83 | 'Filter the form elements by status.', |
84 | 84 | 'event_espresso' |
@@ -20,80 +20,80 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * FormElementConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_Form_Element $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Form_Element $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
23 | + /** |
|
24 | + * FormElementConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_Form_Element $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Form_Element $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => 'RootQuery', |
|
41 | - 'toType' => $this->namespace . 'FormElement', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormElements', |
|
43 | - 'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection", |
|
44 | - 'connectionArgs' => $this->get_connection_args(), |
|
45 | - 'resolve' => [$this, 'resolveConnection'], |
|
46 | - ]; |
|
47 | - } |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => 'RootQuery', |
|
41 | + 'toType' => $this->namespace . 'FormElement', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace) . 'FormElements', |
|
43 | + 'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection", |
|
44 | + 'connectionArgs' => $this->get_connection_args(), |
|
45 | + 'resolve' => [$this, 'resolveConnection'], |
|
46 | + ]; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @param $entity |
|
52 | - * @param $args |
|
53 | - * @param $context |
|
54 | - * @param $info |
|
55 | - * @return FormElementConnectionResolver |
|
56 | - * @throws Exception |
|
57 | - */ |
|
58 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | - { |
|
60 | - return new FormElementConnectionResolver($entity, $args, $context, $info); |
|
61 | - } |
|
50 | + /** |
|
51 | + * @param $entity |
|
52 | + * @param $args |
|
53 | + * @param $context |
|
54 | + * @param $info |
|
55 | + * @return FormElementConnectionResolver |
|
56 | + * @throws Exception |
|
57 | + */ |
|
58 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | + { |
|
60 | + return new FormElementConnectionResolver($entity, $args, $context, $info); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Given an optional array of args, this returns the args to be used in the connection |
|
65 | - * |
|
66 | - * @param array $args The args to modify the defaults |
|
67 | - * @return array |
|
68 | - */ |
|
69 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | - public function get_connection_args(array $args = []): array |
|
71 | - { |
|
72 | - $newArgs = [ |
|
73 | - 'belongsTo' => [ |
|
74 | - 'type' => ['list_of' => 'ID'], |
|
75 | - 'description' => esc_html__( |
|
76 | - 'Related entity IDs to get the form elements for.', |
|
77 | - 'event_espresso' |
|
78 | - ), |
|
79 | - ], |
|
80 | - 'status' => [ |
|
81 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
82 | - 'description' => esc_html__( |
|
83 | - 'Filter the form elements by status.', |
|
84 | - 'event_espresso' |
|
85 | - ), |
|
86 | - ], |
|
87 | - ]; |
|
63 | + /** |
|
64 | + * Given an optional array of args, this returns the args to be used in the connection |
|
65 | + * |
|
66 | + * @param array $args The args to modify the defaults |
|
67 | + * @return array |
|
68 | + */ |
|
69 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | + public function get_connection_args(array $args = []): array |
|
71 | + { |
|
72 | + $newArgs = [ |
|
73 | + 'belongsTo' => [ |
|
74 | + 'type' => ['list_of' => 'ID'], |
|
75 | + 'description' => esc_html__( |
|
76 | + 'Related entity IDs to get the form elements for.', |
|
77 | + 'event_espresso' |
|
78 | + ), |
|
79 | + ], |
|
80 | + 'status' => [ |
|
81 | + 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
82 | + 'description' => esc_html__( |
|
83 | + 'Filter the form elements by status.', |
|
84 | + 'event_espresso' |
|
85 | + ), |
|
86 | + ], |
|
87 | + ]; |
|
88 | 88 | |
89 | - $newArgs = apply_filters( |
|
90 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_element_args', |
|
91 | - $newArgs, |
|
92 | - $args |
|
93 | - ); |
|
94 | - return array_merge( |
|
95 | - $newArgs, |
|
96 | - $args |
|
97 | - ); |
|
98 | - } |
|
89 | + $newArgs = apply_filters( |
|
90 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_element_args', |
|
91 | + $newArgs, |
|
92 | + $args |
|
93 | + ); |
|
94 | + return array_merge( |
|
95 | + $newArgs, |
|
96 | + $args |
|
97 | + ); |
|
98 | + } |
|
99 | 99 | } |
@@ -20,87 +20,87 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * FormSectionConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_Form_Section $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Form_Section $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
23 | + /** |
|
24 | + * FormSectionConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_Form_Section $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Form_Section $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => 'RootQuery', |
|
41 | - 'toType' => $this->namespace . 'FormSection', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormSections', |
|
43 | - 'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection", |
|
44 | - 'connectionArgs' => $this->get_connection_args(), |
|
45 | - 'resolve' => [$this, 'resolveConnection'], |
|
46 | - ]; |
|
47 | - } |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => 'RootQuery', |
|
41 | + 'toType' => $this->namespace . 'FormSection', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace) . 'FormSections', |
|
43 | + 'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection", |
|
44 | + 'connectionArgs' => $this->get_connection_args(), |
|
45 | + 'resolve' => [$this, 'resolveConnection'], |
|
46 | + ]; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @param $entity |
|
52 | - * @param $args |
|
53 | - * @param $context |
|
54 | - * @param $info |
|
55 | - * @return FormSectionConnectionResolver |
|
56 | - * @throws Exception |
|
57 | - */ |
|
58 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | - { |
|
60 | - return new FormSectionConnectionResolver($entity, $args, $context, $info); |
|
61 | - } |
|
50 | + /** |
|
51 | + * @param $entity |
|
52 | + * @param $args |
|
53 | + * @param $context |
|
54 | + * @param $info |
|
55 | + * @return FormSectionConnectionResolver |
|
56 | + * @throws Exception |
|
57 | + */ |
|
58 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | + { |
|
60 | + return new FormSectionConnectionResolver($entity, $args, $context, $info); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Given an optional array of args, this returns the args to be used in the connection |
|
65 | - * |
|
66 | - * @param array $args The args to modify the defaults |
|
67 | - * @return array |
|
68 | - */ |
|
69 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | - public function get_connection_args(array $args = []): array |
|
71 | - { |
|
72 | - $newArgs = [ |
|
73 | - 'appliesTo' => [ |
|
74 | - 'type' => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'], |
|
75 | - 'description' => esc_html__( |
|
76 | - 'Form user types to get the form sections for.', |
|
77 | - 'event_espresso' |
|
78 | - ), |
|
79 | - ], |
|
80 | - 'belongsTo' => [ |
|
81 | - 'type' => ['list_of' => 'ID'], |
|
82 | - 'description' => esc_html__( |
|
83 | - 'Related entity IDs to get the form sections for.', |
|
84 | - 'event_espresso' |
|
85 | - ), |
|
86 | - ], |
|
87 | - 'status' => [ |
|
88 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
89 | - 'description' => esc_html__( |
|
90 | - 'Filter the form sections by status.', |
|
91 | - 'event_espresso' |
|
92 | - ), |
|
93 | - ], |
|
94 | - ]; |
|
63 | + /** |
|
64 | + * Given an optional array of args, this returns the args to be used in the connection |
|
65 | + * |
|
66 | + * @param array $args The args to modify the defaults |
|
67 | + * @return array |
|
68 | + */ |
|
69 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | + public function get_connection_args(array $args = []): array |
|
71 | + { |
|
72 | + $newArgs = [ |
|
73 | + 'appliesTo' => [ |
|
74 | + 'type' => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'], |
|
75 | + 'description' => esc_html__( |
|
76 | + 'Form user types to get the form sections for.', |
|
77 | + 'event_espresso' |
|
78 | + ), |
|
79 | + ], |
|
80 | + 'belongsTo' => [ |
|
81 | + 'type' => ['list_of' => 'ID'], |
|
82 | + 'description' => esc_html__( |
|
83 | + 'Related entity IDs to get the form sections for.', |
|
84 | + 'event_espresso' |
|
85 | + ), |
|
86 | + ], |
|
87 | + 'status' => [ |
|
88 | + 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
89 | + 'description' => esc_html__( |
|
90 | + 'Filter the form sections by status.', |
|
91 | + 'event_espresso' |
|
92 | + ), |
|
93 | + ], |
|
94 | + ]; |
|
95 | 95 | |
96 | - $newArgs = apply_filters( |
|
97 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_section_args', |
|
98 | - $newArgs, |
|
99 | - $args |
|
100 | - ); |
|
101 | - return array_merge( |
|
102 | - $newArgs, |
|
103 | - $args |
|
104 | - ); |
|
105 | - } |
|
96 | + $newArgs = apply_filters( |
|
97 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__form_section_args', |
|
98 | + $newArgs, |
|
99 | + $args |
|
100 | + ); |
|
101 | + return array_merge( |
|
102 | + $newArgs, |
|
103 | + $args |
|
104 | + ); |
|
105 | + } |
|
106 | 106 | } |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | { |
39 | 39 | return [ |
40 | 40 | 'fromType' => 'RootQuery', |
41 | - 'toType' => $this->namespace . 'FormSection', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'FormSections', |
|
41 | + 'toType' => $this->namespace.'FormSection', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace).'FormSections', |
|
43 | 43 | 'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection", |
44 | 44 | 'connectionArgs' => $this->get_connection_args(), |
45 | 45 | 'resolve' => [$this, 'resolveConnection'], |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | $newArgs = [ |
73 | 73 | 'appliesTo' => [ |
74 | - 'type' => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'], |
|
74 | + 'type' => ['list_of' => $this->namespace.'FormSectionAppliesToEnum'], |
|
75 | 75 | 'description' => esc_html__( |
76 | 76 | 'Form user types to get the form sections for.', |
77 | 77 | 'event_espresso' |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ), |
86 | 86 | ], |
87 | 87 | 'status' => [ |
88 | - 'type' => ['list_of' => $this->namespace . 'FormSectionStatusEnum'], |
|
88 | + 'type' => ['list_of' => $this->namespace.'FormSectionStatusEnum'], |
|
89 | 89 | 'description' => esc_html__( |
90 | 90 | 'Filter the form sections by status.', |
91 | 91 | 'event_espresso' |
@@ -20,43 +20,43 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * DatetimeConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_Datetime $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Datetime $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => 'RootQuery', |
|
41 | - 'toType' => $this->namespace . 'Datetime', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace . 'Datetimes'), |
|
43 | - 'connectionTypeName' => "{$this->namespace}RootQueryDatetimesConnection", |
|
44 | - 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
|
45 | - 'resolve' => [$this, 'resolveConnection'], |
|
46 | - ]; |
|
47 | - } |
|
48 | - |
|
49 | - |
|
50 | - /** |
|
51 | - * @param $entity |
|
52 | - * @param $args |
|
53 | - * @param $context |
|
54 | - * @param $info |
|
55 | - * @return DatetimeConnectionResolver |
|
56 | - * @throws Exception |
|
57 | - */ |
|
58 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | - { |
|
60 | - return new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
61 | - } |
|
23 | + /** |
|
24 | + * DatetimeConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_Datetime $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Datetime $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => 'RootQuery', |
|
41 | + 'toType' => $this->namespace . 'Datetime', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace . 'Datetimes'), |
|
43 | + 'connectionTypeName' => "{$this->namespace}RootQueryDatetimesConnection", |
|
44 | + 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
|
45 | + 'resolve' => [$this, 'resolveConnection'], |
|
46 | + ]; |
|
47 | + } |
|
48 | + |
|
49 | + |
|
50 | + /** |
|
51 | + * @param $entity |
|
52 | + * @param $args |
|
53 | + * @param $context |
|
54 | + * @param $info |
|
55 | + * @return DatetimeConnectionResolver |
|
56 | + * @throws Exception |
|
57 | + */ |
|
58 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | + { |
|
60 | + return new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
61 | + } |
|
62 | 62 | } |
@@ -19,44 +19,44 @@ |
||
19 | 19 | class TicketDatetimesConnection extends ConnectionBase |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * DatetimeConnection constructor. |
|
24 | - * |
|
25 | - * @param EEM_Datetime $model |
|
26 | - */ |
|
27 | - public function __construct(EEM_Datetime $model) |
|
28 | - { |
|
29 | - parent::__construct($model); |
|
30 | - } |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * @return array |
|
35 | - */ |
|
36 | - public function config(): array |
|
37 | - { |
|
38 | - return [ |
|
39 | - 'fromType' => $this->namespace . 'Ticket', |
|
40 | - 'toType' => $this->namespace . 'Datetime', |
|
41 | - 'fromFieldName' => 'datetimes', |
|
42 | - 'connectionTypeName' => "{$this->namespace}TicketDatetimesConnection", |
|
43 | - 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
|
44 | - 'resolve' => [$this, 'resolveConnection'], |
|
45 | - ]; |
|
46 | - } |
|
47 | - |
|
48 | - |
|
49 | - /** |
|
50 | - * @param $entity |
|
51 | - * @param $args |
|
52 | - * @param $context |
|
53 | - * @param $info |
|
54 | - * @return array|Deferred|mixed |
|
55 | - * @throws Exception |
|
56 | - */ |
|
57 | - public function resolveConnection($entity, $args, $context, $info) |
|
58 | - { |
|
59 | - $resolver = new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
60 | - return $resolver->get_connection(); |
|
61 | - } |
|
22 | + /** |
|
23 | + * DatetimeConnection constructor. |
|
24 | + * |
|
25 | + * @param EEM_Datetime $model |
|
26 | + */ |
|
27 | + public function __construct(EEM_Datetime $model) |
|
28 | + { |
|
29 | + parent::__construct($model); |
|
30 | + } |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * @return array |
|
35 | + */ |
|
36 | + public function config(): array |
|
37 | + { |
|
38 | + return [ |
|
39 | + 'fromType' => $this->namespace . 'Ticket', |
|
40 | + 'toType' => $this->namespace . 'Datetime', |
|
41 | + 'fromFieldName' => 'datetimes', |
|
42 | + 'connectionTypeName' => "{$this->namespace}TicketDatetimesConnection", |
|
43 | + 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
|
44 | + 'resolve' => [$this, 'resolveConnection'], |
|
45 | + ]; |
|
46 | + } |
|
47 | + |
|
48 | + |
|
49 | + /** |
|
50 | + * @param $entity |
|
51 | + * @param $args |
|
52 | + * @param $context |
|
53 | + * @param $info |
|
54 | + * @return array|Deferred|mixed |
|
55 | + * @throws Exception |
|
56 | + */ |
|
57 | + public function resolveConnection($entity, $args, $context, $info) |
|
58 | + { |
|
59 | + $resolver = new DatetimeConnectionResolver($entity, $args, $context, $info); |
|
60 | + return $resolver->get_connection(); |
|
61 | + } |
|
62 | 62 | } |
@@ -36,8 +36,8 @@ |
||
36 | 36 | public function config(): array |
37 | 37 | { |
38 | 38 | return [ |
39 | - 'fromType' => $this->namespace . 'Ticket', |
|
40 | - 'toType' => $this->namespace . 'Datetime', |
|
39 | + 'fromType' => $this->namespace.'Ticket', |
|
40 | + 'toType' => $this->namespace.'Datetime', |
|
41 | 41 | 'fromFieldName' => 'datetimes', |
42 | 42 | 'connectionTypeName' => "{$this->namespace}TicketDatetimesConnection", |
43 | 43 | 'connectionArgs' => EventDatetimesConnection::get_connection_args(), |
@@ -20,43 +20,43 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * DatetimeConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_Venue $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Venue $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => $this->namespace . 'Event', |
|
41 | - 'toType' => $this->namespace . 'Venue', |
|
42 | - 'fromFieldName' => 'venues', |
|
43 | - 'connectionTypeName' => "{$this->namespace}EventVenuesConnection", |
|
44 | - 'resolve' => [$this, 'resolveConnection'], |
|
45 | - ]; |
|
46 | - } |
|
47 | - |
|
48 | - |
|
49 | - /** |
|
50 | - * @param $entity |
|
51 | - * @param $args |
|
52 | - * @param $context |
|
53 | - * @param $info |
|
54 | - * @return array|Deferred|mixed |
|
55 | - * @throws Exception |
|
56 | - */ |
|
57 | - public function resolveConnection($entity, $args, $context, $info) |
|
58 | - { |
|
59 | - $resolver = new VenueConnectionResolver($entity, $args, $context, $info); |
|
60 | - return $resolver->get_connection(); |
|
61 | - } |
|
23 | + /** |
|
24 | + * DatetimeConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_Venue $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Venue $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => $this->namespace . 'Event', |
|
41 | + 'toType' => $this->namespace . 'Venue', |
|
42 | + 'fromFieldName' => 'venues', |
|
43 | + 'connectionTypeName' => "{$this->namespace}EventVenuesConnection", |
|
44 | + 'resolve' => [$this, 'resolveConnection'], |
|
45 | + ]; |
|
46 | + } |
|
47 | + |
|
48 | + |
|
49 | + /** |
|
50 | + * @param $entity |
|
51 | + * @param $args |
|
52 | + * @param $context |
|
53 | + * @param $info |
|
54 | + * @return array|Deferred|mixed |
|
55 | + * @throws Exception |
|
56 | + */ |
|
57 | + public function resolveConnection($entity, $args, $context, $info) |
|
58 | + { |
|
59 | + $resolver = new VenueConnectionResolver($entity, $args, $context, $info); |
|
60 | + return $resolver->get_connection(); |
|
61 | + } |
|
62 | 62 | } |
@@ -37,8 +37,8 @@ |
||
37 | 37 | public function config(): array |
38 | 38 | { |
39 | 39 | return [ |
40 | - 'fromType' => $this->namespace . 'Event', |
|
41 | - 'toType' => $this->namespace . 'Venue', |
|
40 | + 'fromType' => $this->namespace.'Event', |
|
41 | + 'toType' => $this->namespace.'Venue', |
|
42 | 42 | 'fromFieldName' => 'venues', |
43 | 43 | 'connectionTypeName' => "{$this->namespace}EventVenuesConnection", |
44 | 44 | 'resolve' => [$this, 'resolveConnection'], |
@@ -20,128 +20,128 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * AttendeeConnection constructor. |
|
25 | - * |
|
26 | - * @param EEM_Attendee $model |
|
27 | - */ |
|
28 | - public function __construct(EEM_Attendee $model) |
|
29 | - { |
|
30 | - parent::__construct($model); |
|
31 | - } |
|
23 | + /** |
|
24 | + * AttendeeConnection constructor. |
|
25 | + * |
|
26 | + * @param EEM_Attendee $model |
|
27 | + */ |
|
28 | + public function __construct(EEM_Attendee $model) |
|
29 | + { |
|
30 | + parent::__construct($model); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function config(): array |
|
38 | - { |
|
39 | - return [ |
|
40 | - 'fromType' => 'RootQuery', |
|
41 | - 'toType' => $this->namespace . 'Attendee', |
|
42 | - 'fromFieldName' => lcfirst($this->namespace) . 'Attendees', |
|
43 | - 'connectionTypeName' => "{$this->namespace}RootQueryAttendeesConnection", |
|
44 | - 'connectionArgs' => self::get_connection_args(), |
|
45 | - 'resolve' => [$this, 'resolveConnection'], |
|
46 | - ]; |
|
47 | - } |
|
34 | + /** |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function config(): array |
|
38 | + { |
|
39 | + return [ |
|
40 | + 'fromType' => 'RootQuery', |
|
41 | + 'toType' => $this->namespace . 'Attendee', |
|
42 | + 'fromFieldName' => lcfirst($this->namespace) . 'Attendees', |
|
43 | + 'connectionTypeName' => "{$this->namespace}RootQueryAttendeesConnection", |
|
44 | + 'connectionArgs' => self::get_connection_args(), |
|
45 | + 'resolve' => [$this, 'resolveConnection'], |
|
46 | + ]; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * @param $entity |
|
52 | - * @param $args |
|
53 | - * @param $context |
|
54 | - * @param $info |
|
55 | - * @return AttendeeConnectionResolver |
|
56 | - * @throws Exception |
|
57 | - */ |
|
58 | - public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | - { |
|
60 | - return new AttendeeConnectionResolver($entity, $args, $context, $info); |
|
61 | - } |
|
50 | + /** |
|
51 | + * @param $entity |
|
52 | + * @param $args |
|
53 | + * @param $context |
|
54 | + * @param $info |
|
55 | + * @return AttendeeConnectionResolver |
|
56 | + * @throws Exception |
|
57 | + */ |
|
58 | + public function getConnectionResolver($entity, $args, $context, $info): AbstractConnectionResolver |
|
59 | + { |
|
60 | + return new AttendeeConnectionResolver($entity, $args, $context, $info); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Given an optional array of args, this returns the args to be used in the connection |
|
65 | - * |
|
66 | - * @param array $args The args to modify the defaults |
|
67 | - * @return array |
|
68 | - */ |
|
69 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | - public static function get_connection_args(array $args = []): array |
|
71 | - { |
|
72 | - $newArgs = [ |
|
73 | - 'datetime' => [ |
|
74 | - 'type' => 'ID', |
|
75 | - 'description' => esc_html__( |
|
76 | - 'Globally unique datetime ID to get the attendees for.', |
|
77 | - 'event_espresso' |
|
78 | - ), |
|
79 | - ], |
|
80 | - 'datetimeIn' => [ |
|
81 | - 'type' => ['list_of' => 'ID'], |
|
82 | - 'description' => esc_html__( |
|
83 | - 'Globally unique datetime IDs to get the attendees for.', |
|
84 | - 'event_espresso' |
|
85 | - ), |
|
86 | - ], |
|
87 | - 'event' => [ |
|
88 | - 'type' => 'ID', |
|
89 | - 'description' => esc_html__( |
|
90 | - 'Globally unique event ID to get the attendees for.', |
|
91 | - 'event_espresso' |
|
92 | - ), |
|
93 | - ], |
|
94 | - 'eventIn' => [ |
|
95 | - 'type' => ['list_of' => 'ID'], |
|
96 | - 'description' => esc_html__( |
|
97 | - 'Globally unique event IDs to get the attendees for.', |
|
98 | - 'event_espresso' |
|
99 | - ), |
|
100 | - ], |
|
101 | - 'orderby' => [ |
|
102 | - 'type' => ['list_of' => 'EspressoAttendeesConnectionOrderbyInput'], |
|
103 | - 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
104 | - ], |
|
105 | - 'regTicket' => [ |
|
106 | - 'type' => 'ID', |
|
107 | - 'description' => esc_html__( |
|
108 | - 'Globally unique registration ticket ID to get the attendees for.', |
|
109 | - 'event_espresso' |
|
110 | - ), |
|
111 | - ], |
|
112 | - 'regTicketIn' => [ |
|
113 | - 'type' => ['list_of' => 'ID'], |
|
114 | - 'description' => esc_html__( |
|
115 | - 'Globally unique registration ticket IDs to get the attendees for.', |
|
116 | - 'event_espresso' |
|
117 | - ), |
|
118 | - ], |
|
119 | - 'regTicketId' => [ |
|
120 | - 'type' => 'Int', |
|
121 | - 'description' => esc_html__('Registration ticket ID to get the attendees for.', 'event_espresso'), |
|
122 | - ], |
|
123 | - 'regTicketIdIn' => [ |
|
124 | - 'type' => ['list_of' => 'Int'], |
|
125 | - 'description' => esc_html__('Registration ticket IDs to get the attendees for.', 'event_espresso'), |
|
126 | - ], |
|
127 | - 'regStatus' => [ |
|
128 | - 'type' => 'EspressoRegistrationStatusEnum', |
|
129 | - 'description' => esc_html__('Limit attendees to registration status.', 'event_espresso'), |
|
130 | - ], |
|
131 | - 'search' => [ |
|
132 | - 'type' => 'String', |
|
133 | - 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
134 | - ], |
|
135 | - ]; |
|
63 | + /** |
|
64 | + * Given an optional array of args, this returns the args to be used in the connection |
|
65 | + * |
|
66 | + * @param array $args The args to modify the defaults |
|
67 | + * @return array |
|
68 | + */ |
|
69 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
70 | + public static function get_connection_args(array $args = []): array |
|
71 | + { |
|
72 | + $newArgs = [ |
|
73 | + 'datetime' => [ |
|
74 | + 'type' => 'ID', |
|
75 | + 'description' => esc_html__( |
|
76 | + 'Globally unique datetime ID to get the attendees for.', |
|
77 | + 'event_espresso' |
|
78 | + ), |
|
79 | + ], |
|
80 | + 'datetimeIn' => [ |
|
81 | + 'type' => ['list_of' => 'ID'], |
|
82 | + 'description' => esc_html__( |
|
83 | + 'Globally unique datetime IDs to get the attendees for.', |
|
84 | + 'event_espresso' |
|
85 | + ), |
|
86 | + ], |
|
87 | + 'event' => [ |
|
88 | + 'type' => 'ID', |
|
89 | + 'description' => esc_html__( |
|
90 | + 'Globally unique event ID to get the attendees for.', |
|
91 | + 'event_espresso' |
|
92 | + ), |
|
93 | + ], |
|
94 | + 'eventIn' => [ |
|
95 | + 'type' => ['list_of' => 'ID'], |
|
96 | + 'description' => esc_html__( |
|
97 | + 'Globally unique event IDs to get the attendees for.', |
|
98 | + 'event_espresso' |
|
99 | + ), |
|
100 | + ], |
|
101 | + 'orderby' => [ |
|
102 | + 'type' => ['list_of' => 'EspressoAttendeesConnectionOrderbyInput'], |
|
103 | + 'description' => esc_html__('What parameter to use to order the objects by.', 'event_espresso'), |
|
104 | + ], |
|
105 | + 'regTicket' => [ |
|
106 | + 'type' => 'ID', |
|
107 | + 'description' => esc_html__( |
|
108 | + 'Globally unique registration ticket ID to get the attendees for.', |
|
109 | + 'event_espresso' |
|
110 | + ), |
|
111 | + ], |
|
112 | + 'regTicketIn' => [ |
|
113 | + 'type' => ['list_of' => 'ID'], |
|
114 | + 'description' => esc_html__( |
|
115 | + 'Globally unique registration ticket IDs to get the attendees for.', |
|
116 | + 'event_espresso' |
|
117 | + ), |
|
118 | + ], |
|
119 | + 'regTicketId' => [ |
|
120 | + 'type' => 'Int', |
|
121 | + 'description' => esc_html__('Registration ticket ID to get the attendees for.', 'event_espresso'), |
|
122 | + ], |
|
123 | + 'regTicketIdIn' => [ |
|
124 | + 'type' => ['list_of' => 'Int'], |
|
125 | + 'description' => esc_html__('Registration ticket IDs to get the attendees for.', 'event_espresso'), |
|
126 | + ], |
|
127 | + 'regStatus' => [ |
|
128 | + 'type' => 'EspressoRegistrationStatusEnum', |
|
129 | + 'description' => esc_html__('Limit attendees to registration status.', 'event_espresso'), |
|
130 | + ], |
|
131 | + 'search' => [ |
|
132 | + 'type' => 'String', |
|
133 | + 'description' => esc_html__('The search keywords', 'event_espresso'), |
|
134 | + ], |
|
135 | + ]; |
|
136 | 136 | |
137 | - $newArgs = apply_filters( |
|
138 | - 'FHEE__EventEspresso_core_domain_services_graphql_connections__attendee_args', |
|
139 | - $newArgs, |
|
140 | - $args |
|
141 | - ); |
|
142 | - return array_merge( |
|
143 | - $newArgs, |
|
144 | - $args |
|
145 | - ); |
|
146 | - } |
|
137 | + $newArgs = apply_filters( |
|
138 | + 'FHEE__EventEspresso_core_domain_services_graphql_connections__attendee_args', |
|
139 | + $newArgs, |
|
140 | + $args |
|
141 | + ); |
|
142 | + return array_merge( |
|
143 | + $newArgs, |
|
144 | + $args |
|
145 | + ); |
|
146 | + } |
|
147 | 147 | } |
@@ -15,27 +15,27 @@ |
||
15 | 15 | */ |
16 | 16 | class PriceTypeLoader extends AbstractLoader |
17 | 17 | { |
18 | - /** |
|
19 | - * @return EEM_Base |
|
20 | - * @throws EE_Error |
|
21 | - * @throws InvalidArgumentException |
|
22 | - * @throws InvalidDataTypeException |
|
23 | - * @throws InvalidInterfaceException |
|
24 | - * @throws ReflectionException |
|
25 | - */ |
|
26 | - protected function getQuery(): EEM_Base |
|
27 | - { |
|
28 | - return EEM_Price_Type::instance(); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @return EEM_Base |
|
20 | + * @throws EE_Error |
|
21 | + * @throws InvalidArgumentException |
|
22 | + * @throws InvalidDataTypeException |
|
23 | + * @throws InvalidInterfaceException |
|
24 | + * @throws ReflectionException |
|
25 | + */ |
|
26 | + protected function getQuery(): EEM_Base |
|
27 | + { |
|
28 | + return EEM_Price_Type::instance(); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * @param array $keys |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - protected function getWhereParams(array $keys): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'PRT_ID' => ['IN', $keys], |
|
39 | - ]; |
|
40 | - } |
|
31 | + /** |
|
32 | + * @param array $keys |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + protected function getWhereParams(array $keys): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'PRT_ID' => ['IN', $keys], |
|
39 | + ]; |
|
40 | + } |
|
41 | 41 | } |
@@ -15,28 +15,28 @@ |
||
15 | 15 | */ |
16 | 16 | class AttendeeLoader extends AbstractLoader |
17 | 17 | { |
18 | - /** |
|
19 | - * @return EEM_Base|EEM_Attendee |
|
20 | - * @throws EE_Error |
|
21 | - * @throws InvalidArgumentException |
|
22 | - * @throws InvalidDataTypeException |
|
23 | - * @throws InvalidInterfaceException |
|
24 | - * @throws ReflectionException |
|
25 | - */ |
|
26 | - protected function getQuery(): EEM_Base |
|
27 | - { |
|
28 | - return EEM_Attendee::instance(); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @return EEM_Base|EEM_Attendee |
|
20 | + * @throws EE_Error |
|
21 | + * @throws InvalidArgumentException |
|
22 | + * @throws InvalidDataTypeException |
|
23 | + * @throws InvalidInterfaceException |
|
24 | + * @throws ReflectionException |
|
25 | + */ |
|
26 | + protected function getQuery(): EEM_Base |
|
27 | + { |
|
28 | + return EEM_Attendee::instance(); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @param array $keys |
|
34 | - * @return array |
|
35 | - */ |
|
36 | - protected function getWhereParams(array $keys): array |
|
37 | - { |
|
38 | - return [ |
|
39 | - 'ATT_ID' => ['IN', $keys], |
|
40 | - ]; |
|
41 | - } |
|
32 | + /** |
|
33 | + * @param array $keys |
|
34 | + * @return array |
|
35 | + */ |
|
36 | + protected function getWhereParams(array $keys): array |
|
37 | + { |
|
38 | + return [ |
|
39 | + 'ATT_ID' => ['IN', $keys], |
|
40 | + ]; |
|
41 | + } |
|
42 | 42 | } |
@@ -15,27 +15,27 @@ |
||
15 | 15 | */ |
16 | 16 | class FormSectionLoader extends AbstractLoader |
17 | 17 | { |
18 | - /** |
|
19 | - * @return EEM_Base |
|
20 | - * @throws EE_Error |
|
21 | - * @throws InvalidArgumentException |
|
22 | - * @throws InvalidDataTypeException |
|
23 | - * @throws InvalidInterfaceException |
|
24 | - * @throws ReflectionException |
|
25 | - */ |
|
26 | - protected function getQuery(): EEM_Base |
|
27 | - { |
|
28 | - return EEM_Form_Section::instance(); |
|
29 | - } |
|
18 | + /** |
|
19 | + * @return EEM_Base |
|
20 | + * @throws EE_Error |
|
21 | + * @throws InvalidArgumentException |
|
22 | + * @throws InvalidDataTypeException |
|
23 | + * @throws InvalidInterfaceException |
|
24 | + * @throws ReflectionException |
|
25 | + */ |
|
26 | + protected function getQuery(): EEM_Base |
|
27 | + { |
|
28 | + return EEM_Form_Section::instance(); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * @param array $keys |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - protected function getWhereParams(array $keys): array |
|
36 | - { |
|
37 | - return [ |
|
38 | - 'FSC_UUID' => ['IN', $keys], |
|
39 | - ]; |
|
40 | - } |
|
31 | + /** |
|
32 | + * @param array $keys |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + protected function getWhereParams(array $keys): array |
|
36 | + { |
|
37 | + return [ |
|
38 | + 'FSC_UUID' => ['IN', $keys], |
|
39 | + ]; |
|
40 | + } |
|
41 | 41 | } |