Completed
Branch RELEASE (416965)
by
unknown
12:55 queued 13s
created
core/domain/services/graphql/Utilities.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
                            && filter_var($options['use_IN_operator'], FILTER_VALIDATE_BOOLEAN);
45 45
         $where_params    = $include_all_args ? $where_args : [];
46 46
         foreach ($where_args as $arg => $value) {
47
-            if (! array_key_exists($arg, $arg_mapping)) {
47
+            if ( ! array_key_exists($arg, $arg_mapping)) {
48 48
                 continue;
49 49
             }
50 50
             if (is_array($value) && ! empty($value)) {
51 51
                 $value = array_map(
52
-                    static function ($value) {
52
+                    static function($value) {
53 53
                         if (is_string($value)) {
54 54
                             $value = sanitize_text_field($value);
55 55
                         }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                 // Use the proper operator.
66 66
                 $value = $use_IN_operator && is_array($ID) ? ['IN', $ID] : $ID;
67 67
             }
68
-            $where_params[ $arg_mapping[ $arg ] ] = $value;
68
+            $where_params[$arg_mapping[$arg]] = $value;
69 69
         }
70 70
         return $where_params;
71 71
     }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $convertToGlobalId = [$this, 'convertToGlobalId'];
100 100
         if (is_array($ID)) {
101 101
             return array_map(
102
-                static function ($id) use ($convertToGlobalId, $type) {
102
+                static function($id) use ($convertToGlobalId, $type) {
103 103
                     return $convertToGlobalId($type, $id);
104 104
                 },
105 105
                 $ID
Please login to merge, or discard this patch.
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -12,99 +12,99 @@
 block discarded – undo
12 12
  */
13 13
 class Utilities
14 14
 {
15
-    /**
16
-     * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model
17
-     * friendly keys.
18
-     *
19
-     * @param array $where_args
20
-     * @param array $arg_mapping        array where keys are GQL field names and values are EE modal field names
21
-     * @param array $id_fields          The fields to convert from global IDs to DB IDs.
22
-     * @param array $options            Additional parameters for modifying args: [
23
-     *                                  'include_all_args' => bool, // will return ALL args in $where_args if true
24
-     *                                  'use_IN_operator' => bool, // arrays of IDs will use SQL IN clause if true
25
-     *                                  ]
26
-     * @return array
27
-     */
28
-    public function sanitizeWhereArgs(
29
-        $where_args,
30
-        $arg_mapping,
31
-        $id_fields,
32
-        $options = []
33
-    ) {
34
-        // if "include_all_args" is true, then the incoming $where_args array
35
-        // will be copied to the outgoing $where_params prior to sanitizing the fields.
36
-        // so ALL elements in the $where_args array will be present in the $where_params array
37
-        $include_all_args = isset($options['include_all_args'])
38
-            ? filter_var($options['include_all_args'], FILTER_VALIDATE_BOOLEAN)
39
-            : false;
40
-        // if "use_IN_operator" is true, then any ID args found in the $id_fields array
41
-        // will have their values converted to use an SQL "IN" clause format
42
-        // if the value returned from Relay::fromGlobalId() is an array of IDs
43
-        $use_IN_operator = isset($options['use_IN_operator'])
44
-                           && filter_var($options['use_IN_operator'], FILTER_VALIDATE_BOOLEAN);
45
-        $where_params    = $include_all_args ? $where_args : [];
46
-        foreach ($where_args as $arg => $value) {
47
-            if (! array_key_exists($arg, $arg_mapping)) {
48
-                continue;
49
-            }
50
-            if (is_array($value) && ! empty($value)) {
51
-                $value = array_map(
52
-                    static function ($value) {
53
-                        if (is_string($value)) {
54
-                            $value = sanitize_text_field($value);
55
-                        }
56
-                        return $value;
57
-                    },
58
-                    $value
59
-                );
60
-            } elseif (is_string($value)) {
61
-                $value = sanitize_text_field($value);
62
-            }
63
-            if (in_array($arg, $id_fields, true)) {
64
-                $ID = $this->convertFromGlobalId($value);
65
-                // Use the proper operator.
66
-                $value = $use_IN_operator && is_array($ID) ? ['IN', $ID] : $ID;
67
-            }
68
-            $where_params[ $arg_mapping[ $arg ] ] = $value;
69
-        }
70
-        return $where_params;
71
-    }
15
+	/**
16
+	 * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model
17
+	 * friendly keys.
18
+	 *
19
+	 * @param array $where_args
20
+	 * @param array $arg_mapping        array where keys are GQL field names and values are EE modal field names
21
+	 * @param array $id_fields          The fields to convert from global IDs to DB IDs.
22
+	 * @param array $options            Additional parameters for modifying args: [
23
+	 *                                  'include_all_args' => bool, // will return ALL args in $where_args if true
24
+	 *                                  'use_IN_operator' => bool, // arrays of IDs will use SQL IN clause if true
25
+	 *                                  ]
26
+	 * @return array
27
+	 */
28
+	public function sanitizeWhereArgs(
29
+		$where_args,
30
+		$arg_mapping,
31
+		$id_fields,
32
+		$options = []
33
+	) {
34
+		// if "include_all_args" is true, then the incoming $where_args array
35
+		// will be copied to the outgoing $where_params prior to sanitizing the fields.
36
+		// so ALL elements in the $where_args array will be present in the $where_params array
37
+		$include_all_args = isset($options['include_all_args'])
38
+			? filter_var($options['include_all_args'], FILTER_VALIDATE_BOOLEAN)
39
+			: false;
40
+		// if "use_IN_operator" is true, then any ID args found in the $id_fields array
41
+		// will have their values converted to use an SQL "IN" clause format
42
+		// if the value returned from Relay::fromGlobalId() is an array of IDs
43
+		$use_IN_operator = isset($options['use_IN_operator'])
44
+						   && filter_var($options['use_IN_operator'], FILTER_VALIDATE_BOOLEAN);
45
+		$where_params    = $include_all_args ? $where_args : [];
46
+		foreach ($where_args as $arg => $value) {
47
+			if (! array_key_exists($arg, $arg_mapping)) {
48
+				continue;
49
+			}
50
+			if (is_array($value) && ! empty($value)) {
51
+				$value = array_map(
52
+					static function ($value) {
53
+						if (is_string($value)) {
54
+							$value = sanitize_text_field($value);
55
+						}
56
+						return $value;
57
+					},
58
+					$value
59
+				);
60
+			} elseif (is_string($value)) {
61
+				$value = sanitize_text_field($value);
62
+			}
63
+			if (in_array($arg, $id_fields, true)) {
64
+				$ID = $this->convertFromGlobalId($value);
65
+				// Use the proper operator.
66
+				$value = $use_IN_operator && is_array($ID) ? ['IN', $ID] : $ID;
67
+			}
68
+			$where_params[ $arg_mapping[ $arg ] ] = $value;
69
+		}
70
+		return $where_params;
71
+	}
72 72
 
73 73
 
74
-    /**
75
-     * Converts global ID to DB ID.
76
-     *
77
-     * @param string|string[] $ID
78
-     * @return mixed
79
-     */
80
-    public function convertFromGlobalId($ID)
81
-    {
82
-        if (is_array($ID)) {
83
-            return array_map([$this, 'convertFromGlobalId'], $ID);
84
-        }
85
-        $parts = Relay::fromGlobalId($ID);
86
-        return ! empty($parts['id']) ? $parts['id'] : null;
87
-    }
74
+	/**
75
+	 * Converts global ID to DB ID.
76
+	 *
77
+	 * @param string|string[] $ID
78
+	 * @return mixed
79
+	 */
80
+	public function convertFromGlobalId($ID)
81
+	{
82
+		if (is_array($ID)) {
83
+			return array_map([$this, 'convertFromGlobalId'], $ID);
84
+		}
85
+		$parts = Relay::fromGlobalId($ID);
86
+		return ! empty($parts['id']) ? $parts['id'] : null;
87
+	}
88 88
 
89 89
 
90
-    /**
91
-     * Convert the DB ID into GID
92
-     *
93
-     * @param string    $type
94
-     * @param int|int[] $ID
95
-     * @return mixed
96
-     */
97
-    public function convertToGlobalId($type, $ID)
98
-    {
99
-        $convertToGlobalId = [$this, 'convertToGlobalId'];
100
-        if (is_array($ID)) {
101
-            return array_map(
102
-                static function ($id) use ($convertToGlobalId, $type) {
103
-                    return $convertToGlobalId($type, $id);
104
-                },
105
-                $ID
106
-            );
107
-        }
108
-        return Relay::toGlobalId($type, $ID);
109
-    }
90
+	/**
91
+	 * Convert the DB ID into GID
92
+	 *
93
+	 * @param string    $type
94
+	 * @param int|int[] $ID
95
+	 * @return mixed
96
+	 */
97
+	public function convertToGlobalId($type, $ID)
98
+	{
99
+		$convertToGlobalId = [$this, 'convertToGlobalId'];
100
+		if (is_array($ID)) {
101
+			return array_map(
102
+				static function ($id) use ($convertToGlobalId, $type) {
103
+					return $convertToGlobalId($type, $id);
104
+				},
105
+				$ID
106
+			);
107
+		}
108
+		return Relay::toGlobalId($type, $ID);
109
+	}
110 110
 }
Please login to merge, or discard this patch.
domain/services/graphql/connections/RootQueryFormElementsConnection.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'
Please login to merge, or discard this patch.
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -18,80 +18,80 @@
 block discarded – undo
18 18
  */
19 19
 class RootQueryFormElementsConnection extends AbstractRootQueryConnection
20 20
 {
21
-    /**
22
-     * FormElementConnection constructor.
23
-     *
24
-     * @param EEM_Form_Element $model
25
-     */
26
-    public function __construct(EEM_Form_Element $model)
27
-    {
28
-        parent::__construct($model);
29
-    }
21
+	/**
22
+	 * FormElementConnection constructor.
23
+	 *
24
+	 * @param EEM_Form_Element $model
25
+	 */
26
+	public function __construct(EEM_Form_Element $model)
27
+	{
28
+		parent::__construct($model);
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @return array
34
-     */
35
-    public function config()
36
-    {
37
-        return [
38
-            'fromType'           => 'RootQuery',
39
-            'toType'             => $this->namespace . 'FormElement',
40
-            'fromFieldName'      => lcfirst($this->namespace) . 'FormElements',
41
-            'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection",
42
-            'connectionArgs'     => $this->get_connection_args(),
43
-            'resolve'            => [$this, 'resolveConnection'],
44
-        ];
45
-    }
32
+	/**
33
+	 * @return array
34
+	 */
35
+	public function config()
36
+	{
37
+		return [
38
+			'fromType'           => 'RootQuery',
39
+			'toType'             => $this->namespace . 'FormElement',
40
+			'fromFieldName'      => lcfirst($this->namespace) . 'FormElements',
41
+			'connectionTypeName' => "{$this->namespace}RootQueryFormElementsConnection",
42
+			'connectionArgs'     => $this->get_connection_args(),
43
+			'resolve'            => [$this, 'resolveConnection'],
44
+		];
45
+	}
46 46
 
47 47
 
48
-    /**
49
-     * @param $entity
50
-     * @param $args
51
-     * @param $context
52
-     * @param $info
53
-     * @return FormElementConnectionResolver
54
-     * @throws Exception
55
-     */
56
-    public function getConnectionResolver($entity, $args, $context, $info)
57
-    {
58
-        return new FormElementConnectionResolver($entity, $args, $context, $info);
59
-    }
48
+	/**
49
+	 * @param $entity
50
+	 * @param $args
51
+	 * @param $context
52
+	 * @param $info
53
+	 * @return FormElementConnectionResolver
54
+	 * @throws Exception
55
+	 */
56
+	public function getConnectionResolver($entity, $args, $context, $info)
57
+	{
58
+		return new FormElementConnectionResolver($entity, $args, $context, $info);
59
+	}
60 60
 
61
-    /**
62
-     * Given an optional array of args, this returns the args to be used in the connection
63
-     *
64
-     * @param array $args The args to modify the defaults
65
-     * @return array
66
-     */
67
-    // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
68
-    public function get_connection_args($args = [])
69
-    {
70
-        $newArgs = [
71
-            'belongsTo' => [
72
-                'type'        => ['list_of' => 'ID'],
73
-                'description' => esc_html__(
74
-                    'Related entity IDs to get the form elements for.',
75
-                    'event_espresso'
76
-                ),
77
-            ],
78
-            'status' => [
79
-                'type'        => ['list_of' => $this->namespace . 'FormSectionStatusEnum'],
80
-                'description' => esc_html__(
81
-                    'Filter the form elements by status.',
82
-                    'event_espresso'
83
-                ),
84
-            ],
85
-        ];
61
+	/**
62
+	 * Given an optional array of args, this returns the args to be used in the connection
63
+	 *
64
+	 * @param array $args The args to modify the defaults
65
+	 * @return array
66
+	 */
67
+	// phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
68
+	public function get_connection_args($args = [])
69
+	{
70
+		$newArgs = [
71
+			'belongsTo' => [
72
+				'type'        => ['list_of' => 'ID'],
73
+				'description' => esc_html__(
74
+					'Related entity IDs to get the form elements for.',
75
+					'event_espresso'
76
+				),
77
+			],
78
+			'status' => [
79
+				'type'        => ['list_of' => $this->namespace . 'FormSectionStatusEnum'],
80
+				'description' => esc_html__(
81
+					'Filter the form elements by status.',
82
+					'event_espresso'
83
+				),
84
+			],
85
+		];
86 86
 
87
-        $newArgs = apply_filters(
88
-            'FHEE__EventEspresso_core_domain_services_graphql_connections__form_element_args',
89
-            $newArgs,
90
-            $args
91
-        );
92
-        return array_merge(
93
-            $newArgs,
94
-            $args
95
-        );
96
-    }
87
+		$newArgs = apply_filters(
88
+			'FHEE__EventEspresso_core_domain_services_graphql_connections__form_element_args',
89
+			$newArgs,
90
+			$args
91
+		);
92
+		return array_merge(
93
+			$newArgs,
94
+			$args
95
+		);
96
+	}
97 97
 }
Please login to merge, or discard this patch.
domain/services/graphql/connections/RootQueryFormSectionsConnection.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'
Please login to merge, or discard this patch.
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -18,87 +18,87 @@
 block discarded – undo
18 18
  */
19 19
 class RootQueryFormSectionsConnection extends AbstractRootQueryConnection
20 20
 {
21
-    /**
22
-     * FormSectionConnection constructor.
23
-     *
24
-     * @param EEM_Form_Section               $model
25
-     */
26
-    public function __construct(EEM_Form_Section $model)
27
-    {
28
-        parent::__construct($model);
29
-    }
21
+	/**
22
+	 * FormSectionConnection constructor.
23
+	 *
24
+	 * @param EEM_Form_Section               $model
25
+	 */
26
+	public function __construct(EEM_Form_Section $model)
27
+	{
28
+		parent::__construct($model);
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @return array
34
-     */
35
-    public function config()
36
-    {
37
-        return [
38
-            'fromType'           => 'RootQuery',
39
-            'toType'             => $this->namespace . 'FormSection',
40
-            'fromFieldName'      => lcfirst($this->namespace) . 'FormSections',
41
-            'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection",
42
-            'connectionArgs'     => $this->get_connection_args(),
43
-            'resolve'            => [$this, 'resolveConnection'],
44
-        ];
45
-    }
32
+	/**
33
+	 * @return array
34
+	 */
35
+	public function config()
36
+	{
37
+		return [
38
+			'fromType'           => 'RootQuery',
39
+			'toType'             => $this->namespace . 'FormSection',
40
+			'fromFieldName'      => lcfirst($this->namespace) . 'FormSections',
41
+			'connectionTypeName' => "{$this->namespace}RootQueryFormSectionsConnection",
42
+			'connectionArgs'     => $this->get_connection_args(),
43
+			'resolve'            => [$this, 'resolveConnection'],
44
+		];
45
+	}
46 46
 
47 47
 
48
-    /**
49
-     * @param $entity
50
-     * @param $args
51
-     * @param $context
52
-     * @param $info
53
-     * @return FormSectionConnectionResolver
54
-     * @throws Exception
55
-     */
56
-    public function getConnectionResolver($entity, $args, $context, $info)
57
-    {
58
-        return new FormSectionConnectionResolver($entity, $args, $context, $info);
59
-    }
48
+	/**
49
+	 * @param $entity
50
+	 * @param $args
51
+	 * @param $context
52
+	 * @param $info
53
+	 * @return FormSectionConnectionResolver
54
+	 * @throws Exception
55
+	 */
56
+	public function getConnectionResolver($entity, $args, $context, $info)
57
+	{
58
+		return new FormSectionConnectionResolver($entity, $args, $context, $info);
59
+	}
60 60
 
61
-    /**
62
-     * Given an optional array of args, this returns the args to be used in the connection
63
-     *
64
-     * @param array $args The args to modify the defaults
65
-     * @return array
66
-     */
67
-    // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
68
-    public function get_connection_args($args = [])
69
-    {
70
-        $newArgs = [
71
-            'appliesTo' => [
72
-                'type'        => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'],
73
-                'description' => esc_html__(
74
-                    'Form user types to get the form sections for.',
75
-                    'event_espresso'
76
-                ),
77
-            ],
78
-            'belongsTo' => [
79
-                'type'        => ['list_of' => 'ID'],
80
-                'description' => esc_html__(
81
-                    'Related entity IDs to get the form sections for.',
82
-                    'event_espresso'
83
-                ),
84
-            ],
85
-            'status' => [
86
-                'type'        => ['list_of' => $this->namespace . 'FormSectionStatusEnum'],
87
-                'description' => esc_html__(
88
-                    'Filter the form sections by status.',
89
-                    'event_espresso'
90
-                ),
91
-            ],
92
-        ];
61
+	/**
62
+	 * Given an optional array of args, this returns the args to be used in the connection
63
+	 *
64
+	 * @param array $args The args to modify the defaults
65
+	 * @return array
66
+	 */
67
+	// phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
68
+	public function get_connection_args($args = [])
69
+	{
70
+		$newArgs = [
71
+			'appliesTo' => [
72
+				'type'        => ['list_of' => $this->namespace . 'FormSectionAppliesToEnum'],
73
+				'description' => esc_html__(
74
+					'Form user types to get the form sections for.',
75
+					'event_espresso'
76
+				),
77
+			],
78
+			'belongsTo' => [
79
+				'type'        => ['list_of' => 'ID'],
80
+				'description' => esc_html__(
81
+					'Related entity IDs to get the form sections for.',
82
+					'event_espresso'
83
+				),
84
+			],
85
+			'status' => [
86
+				'type'        => ['list_of' => $this->namespace . 'FormSectionStatusEnum'],
87
+				'description' => esc_html__(
88
+					'Filter the form sections by status.',
89
+					'event_espresso'
90
+				),
91
+			],
92
+		];
93 93
 
94
-        $newArgs = apply_filters(
95
-            'FHEE__EventEspresso_core_domain_services_graphql_connections__form_section_args',
96
-            $newArgs,
97
-            $args
98
-        );
99
-        return array_merge(
100
-            $newArgs,
101
-            $args
102
-        );
103
-    }
94
+		$newArgs = apply_filters(
95
+			'FHEE__EventEspresso_core_domain_services_graphql_connections__form_section_args',
96
+			$newArgs,
97
+			$args
98
+		);
99
+		return array_merge(
100
+			$newArgs,
101
+			$args
102
+		);
103
+	}
104 104
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/data/mutations/VenueMutation.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -25,83 +25,83 @@
 block discarded – undo
25 25
     {
26 26
         $args = [];
27 27
 
28
-        if (! empty($input['name'])) {
28
+        if ( ! empty($input['name'])) {
29 29
             $args['VNU_name'] = sanitize_text_field($input['name']);
30 30
         }
31 31
 
32
-        if (! empty($input['description'])) {
32
+        if ( ! empty($input['description'])) {
33 33
             $args['VNU_desc'] = wp_kses_post($input['description']);
34 34
         }
35 35
 
36
-        if (! empty($input['shortDescription'])) {
36
+        if ( ! empty($input['shortDescription'])) {
37 37
             $args['VNU_short_desc'] = sanitize_text_field($input['shortDescription']);
38 38
         }
39 39
 
40
-        if (! empty($input['identifier'])) {
40
+        if ( ! empty($input['identifier'])) {
41 41
             $args['VNU_identifier'] = sanitize_title($input['identifier']);
42 42
         }
43 43
 
44
-        if (! empty($input['created'])) {
44
+        if ( ! empty($input['created'])) {
45 45
             $args['VNU_created'] = new DateTime(sanitize_text_field($input['created']));
46 46
         }
47 47
 
48
-        if (! empty($input['order'])) {
48
+        if ( ! empty($input['order'])) {
49 49
             $args['VNU_order'] = absint($input['order']);
50 50
         }
51 51
 
52
-        if (! empty($input['wpUser'])) {
52
+        if ( ! empty($input['wpUser'])) {
53 53
             $args['VNU_wp_user'] = absint($input['wpUser']);
54 54
         }
55 55
 
56
-        if (! empty($input['address'])) {
56
+        if ( ! empty($input['address'])) {
57 57
             $args['VNU_address'] = sanitize_text_field($input['address']);
58 58
         }
59 59
 
60
-        if (! empty($input['address2'])) {
60
+        if ( ! empty($input['address2'])) {
61 61
             $args['VNU_address2'] = sanitize_text_field($input['address2']);
62 62
         }
63 63
 
64
-        if (! empty($input['city'])) {
64
+        if ( ! empty($input['city'])) {
65 65
             $args['VNU_city'] = sanitize_text_field($input['city']);
66 66
         }
67 67
 
68
-        if (! empty($input['state'])) {
68
+        if ( ! empty($input['state'])) {
69 69
             $args['STA_ID'] = absint($input['state']);
70 70
         }
71 71
 
72
-        if (! empty($input['country'])) {
72
+        if ( ! empty($input['country'])) {
73 73
             $args['CNT_ISO'] = sanitize_text_field($input['country']);
74 74
         }
75 75
 
76
-        if (! empty($input['zip'])) {
76
+        if ( ! empty($input['zip'])) {
77 77
             $args['VNU_zip'] = sanitize_text_field($input['zip']);
78 78
         }
79 79
 
80
-        if (! empty($input['capacity'])) {
80
+        if ( ! empty($input['capacity'])) {
81 81
             $args['VNU_capacity'] = absint($input['capacity']);
82 82
         }
83 83
 
84
-        if (! empty($input['phone'])) {
84
+        if ( ! empty($input['phone'])) {
85 85
             $args['VNU_phone'] = sanitize_text_field($input['phone']);
86 86
         }
87 87
 
88
-        if (! empty($input['virtualPhone'])) {
88
+        if ( ! empty($input['virtualPhone'])) {
89 89
             $args['VNU_virtual_phone'] = sanitize_text_field($input['virtualPhone']);
90 90
         }
91 91
 
92
-        if (! empty($input['url'])) {
92
+        if ( ! empty($input['url'])) {
93 93
             $args['VNU_url'] = sanitize_text_field($input['url']);
94 94
         }
95 95
 
96
-        if (! empty($input['virtualUrl'])) {
96
+        if ( ! empty($input['virtualUrl'])) {
97 97
             $args['VNU_virtual_url'] = sanitize_text_field($input['virtualUrl']);
98 98
         }
99 99
 
100
-        if (! empty($input['googleMapLink'])) {
100
+        if ( ! empty($input['googleMapLink'])) {
101 101
             $args['VNU_google_map_link'] = sanitize_text_field($input['googleMapLink']);
102 102
         }
103 103
 
104
-        if (! empty($input['enableForGmap'])) {
104
+        if ( ! empty($input['enableForGmap'])) {
105 105
             $args['VNU_enable_for_gmap'] = (bool) $input['enableForGmap'];
106 106
         }
107 107
 
Please login to merge, or discard this patch.
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -13,101 +13,101 @@
 block discarded – undo
13 13
  */
14 14
 class VenueMutation
15 15
 {
16
-    /**
17
-     * Maps the GraphQL input to a format that the model functions can use
18
-     *
19
-     * @param array  $input         Data coming from the GraphQL mutation query input
20
-     * @return array
21
-     * @throws Exception
22
-     */
23
-    public static function prepareFields($input)
24
-    {
25
-        $args = [];
26
-
27
-        if (! empty($input['name'])) {
28
-            $args['VNU_name'] = sanitize_text_field($input['name']);
29
-        }
30
-
31
-        if (! empty($input['description'])) {
32
-            $args['VNU_desc'] = wp_kses_post($input['description']);
33
-        }
34
-
35
-        if (! empty($input['shortDescription'])) {
36
-            $args['VNU_short_desc'] = sanitize_text_field($input['shortDescription']);
37
-        }
38
-
39
-        if (! empty($input['identifier'])) {
40
-            $args['VNU_identifier'] = sanitize_title($input['identifier']);
41
-        }
42
-
43
-        if (! empty($input['created'])) {
44
-            $args['VNU_created'] = new DateTime(sanitize_text_field($input['created']));
45
-        }
46
-
47
-        if (! empty($input['order'])) {
48
-            $args['VNU_order'] = absint($input['order']);
49
-        }
50
-
51
-        if (! empty($input['wpUser'])) {
52
-            $args['VNU_wp_user'] = absint($input['wpUser']);
53
-        }
54
-
55
-        if (! empty($input['address'])) {
56
-            $args['VNU_address'] = sanitize_text_field($input['address']);
57
-        }
58
-
59
-        if (! empty($input['address2'])) {
60
-            $args['VNU_address2'] = sanitize_text_field($input['address2']);
61
-        }
62
-
63
-        if (! empty($input['city'])) {
64
-            $args['VNU_city'] = sanitize_text_field($input['city']);
65
-        }
66
-
67
-        if (! empty($input['state'])) {
68
-            $args['STA_ID'] = absint($input['state']);
69
-        }
70
-
71
-        if (! empty($input['country'])) {
72
-            $args['CNT_ISO'] = sanitize_text_field($input['country']);
73
-        }
74
-
75
-        if (! empty($input['zip'])) {
76
-            $args['VNU_zip'] = sanitize_text_field($input['zip']);
77
-        }
78
-
79
-        if (! empty($input['capacity'])) {
80
-            $args['VNU_capacity'] = absint($input['capacity']);
81
-        }
82
-
83
-        if (! empty($input['phone'])) {
84
-            $args['VNU_phone'] = sanitize_text_field($input['phone']);
85
-        }
86
-
87
-        if (! empty($input['virtualPhone'])) {
88
-            $args['VNU_virtual_phone'] = sanitize_text_field($input['virtualPhone']);
89
-        }
90
-
91
-        if (! empty($input['url'])) {
92
-            $args['VNU_url'] = sanitize_text_field($input['url']);
93
-        }
94
-
95
-        if (! empty($input['virtualUrl'])) {
96
-            $args['VNU_virtual_url'] = sanitize_text_field($input['virtualUrl']);
97
-        }
98
-
99
-        if (! empty($input['googleMapLink'])) {
100
-            $args['VNU_google_map_link'] = sanitize_text_field($input['googleMapLink']);
101
-        }
102
-
103
-        if (! empty($input['enableForGmap'])) {
104
-            $args['VNU_enable_for_gmap'] = (bool) $input['enableForGmap'];
105
-        }
106
-
107
-        return apply_filters(
108
-            'FHEE__EventEspresso_core_domain_services_graphql_data_mutations__venue_args',
109
-            $args,
110
-            $input
111
-        );
112
-    }
16
+	/**
17
+	 * Maps the GraphQL input to a format that the model functions can use
18
+	 *
19
+	 * @param array  $input         Data coming from the GraphQL mutation query input
20
+	 * @return array
21
+	 * @throws Exception
22
+	 */
23
+	public static function prepareFields($input)
24
+	{
25
+		$args = [];
26
+
27
+		if (! empty($input['name'])) {
28
+			$args['VNU_name'] = sanitize_text_field($input['name']);
29
+		}
30
+
31
+		if (! empty($input['description'])) {
32
+			$args['VNU_desc'] = wp_kses_post($input['description']);
33
+		}
34
+
35
+		if (! empty($input['shortDescription'])) {
36
+			$args['VNU_short_desc'] = sanitize_text_field($input['shortDescription']);
37
+		}
38
+
39
+		if (! empty($input['identifier'])) {
40
+			$args['VNU_identifier'] = sanitize_title($input['identifier']);
41
+		}
42
+
43
+		if (! empty($input['created'])) {
44
+			$args['VNU_created'] = new DateTime(sanitize_text_field($input['created']));
45
+		}
46
+
47
+		if (! empty($input['order'])) {
48
+			$args['VNU_order'] = absint($input['order']);
49
+		}
50
+
51
+		if (! empty($input['wpUser'])) {
52
+			$args['VNU_wp_user'] = absint($input['wpUser']);
53
+		}
54
+
55
+		if (! empty($input['address'])) {
56
+			$args['VNU_address'] = sanitize_text_field($input['address']);
57
+		}
58
+
59
+		if (! empty($input['address2'])) {
60
+			$args['VNU_address2'] = sanitize_text_field($input['address2']);
61
+		}
62
+
63
+		if (! empty($input['city'])) {
64
+			$args['VNU_city'] = sanitize_text_field($input['city']);
65
+		}
66
+
67
+		if (! empty($input['state'])) {
68
+			$args['STA_ID'] = absint($input['state']);
69
+		}
70
+
71
+		if (! empty($input['country'])) {
72
+			$args['CNT_ISO'] = sanitize_text_field($input['country']);
73
+		}
74
+
75
+		if (! empty($input['zip'])) {
76
+			$args['VNU_zip'] = sanitize_text_field($input['zip']);
77
+		}
78
+
79
+		if (! empty($input['capacity'])) {
80
+			$args['VNU_capacity'] = absint($input['capacity']);
81
+		}
82
+
83
+		if (! empty($input['phone'])) {
84
+			$args['VNU_phone'] = sanitize_text_field($input['phone']);
85
+		}
86
+
87
+		if (! empty($input['virtualPhone'])) {
88
+			$args['VNU_virtual_phone'] = sanitize_text_field($input['virtualPhone']);
89
+		}
90
+
91
+		if (! empty($input['url'])) {
92
+			$args['VNU_url'] = sanitize_text_field($input['url']);
93
+		}
94
+
95
+		if (! empty($input['virtualUrl'])) {
96
+			$args['VNU_virtual_url'] = sanitize_text_field($input['virtualUrl']);
97
+		}
98
+
99
+		if (! empty($input['googleMapLink'])) {
100
+			$args['VNU_google_map_link'] = sanitize_text_field($input['googleMapLink']);
101
+		}
102
+
103
+		if (! empty($input['enableForGmap'])) {
104
+			$args['VNU_enable_for_gmap'] = (bool) $input['enableForGmap'];
105
+		}
106
+
107
+		return apply_filters(
108
+			'FHEE__EventEspresso_core_domain_services_graphql_data_mutations__venue_args',
109
+			$args,
110
+			$input
111
+		);
112
+	}
113 113
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/types/State.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function __construct(EEM_State $state_model)
29 29
     {
30
-        $this->setName($this->namespace . 'State');
30
+        $this->setName($this->namespace.'State');
31 31
         $this->setDescription(__('A state', 'event_espresso'));
32 32
         $this->setIsCustomPostType(false);
33 33
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             ),
80 80
             new GraphQLOutputField(
81 81
                 'country',
82
-                $this->namespace . 'Country',
82
+                $this->namespace.'Country',
83 83
                 null,
84 84
                 esc_html__('Country for the state', 'event_espresso')
85 85
             ),
Please login to merge, or discard this patch.
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -20,82 +20,82 @@
 block discarded – undo
20 20
  */
21 21
 class State extends TypeBase
22 22
 {
23
-    /**
24
-     * State constructor.
25
-     *
26
-     * @param EEM_State $state_model
27
-     */
28
-    public function __construct(EEM_State $state_model)
29
-    {
30
-        $this->setName($this->namespace . 'State');
31
-        $this->setDescription(__('A state', 'event_espresso'));
32
-        $this->setIsCustomPostType(false);
23
+	/**
24
+	 * State constructor.
25
+	 *
26
+	 * @param EEM_State $state_model
27
+	 */
28
+	public function __construct(EEM_State $state_model)
29
+	{
30
+		$this->setName($this->namespace . 'State');
31
+		$this->setDescription(__('A state', 'event_espresso'));
32
+		$this->setIsCustomPostType(false);
33 33
 
34
-        parent::__construct($state_model);
35
-    }
34
+		parent::__construct($state_model);
35
+	}
36 36
 
37 37
 
38
-    /**
39
-     * @return GraphQLFieldInterface[]
40
-     */
41
-    public function getFields()
42
-    {
43
-        $fields = [
44
-            new GraphQLField(
45
-                'id',
46
-                ['non_null' => 'ID'],
47
-                null,
48
-                esc_html__('The globally unique ID for the object.', 'event_espresso')
49
-            ),
50
-            new GraphQLOutputField(
51
-                'dbId',
52
-                ['non_null' => 'Int'],
53
-                'ID',
54
-                esc_html__('State ID', 'event_espresso')
55
-            ),
56
-            new GraphQLField(
57
-                'abbreviation',
58
-                'String',
59
-                'abbrev',
60
-                esc_html__('State Abbreviation', 'event_espresso')
61
-            ),
62
-            new GraphQLOutputField(
63
-                'cacheId',
64
-                ['non_null' => 'String'],
65
-                null,
66
-                esc_html__('The cache ID of the object.', 'event_espresso')
67
-            ),
68
-            new GraphQLField(
69
-                'name',
70
-                'String',
71
-                'name',
72
-                esc_html__('State Name', 'event_espresso')
73
-            ),
74
-            new GraphQLField(
75
-                'isActive',
76
-                'Boolean',
77
-                'active',
78
-                esc_html__('State Active Flag', 'event_espresso')
79
-            ),
80
-            new GraphQLOutputField(
81
-                'country',
82
-                $this->namespace . 'Country',
83
-                null,
84
-                esc_html__('Country for the state', 'event_espresso')
85
-            ),
86
-            new GraphQLInputField(
87
-                'country',
88
-                'String',
89
-                null,
90
-                esc_html__('Country ISO Code', 'event_espresso')
91
-            ),
92
-        ];
38
+	/**
39
+	 * @return GraphQLFieldInterface[]
40
+	 */
41
+	public function getFields()
42
+	{
43
+		$fields = [
44
+			new GraphQLField(
45
+				'id',
46
+				['non_null' => 'ID'],
47
+				null,
48
+				esc_html__('The globally unique ID for the object.', 'event_espresso')
49
+			),
50
+			new GraphQLOutputField(
51
+				'dbId',
52
+				['non_null' => 'Int'],
53
+				'ID',
54
+				esc_html__('State ID', 'event_espresso')
55
+			),
56
+			new GraphQLField(
57
+				'abbreviation',
58
+				'String',
59
+				'abbrev',
60
+				esc_html__('State Abbreviation', 'event_espresso')
61
+			),
62
+			new GraphQLOutputField(
63
+				'cacheId',
64
+				['non_null' => 'String'],
65
+				null,
66
+				esc_html__('The cache ID of the object.', 'event_espresso')
67
+			),
68
+			new GraphQLField(
69
+				'name',
70
+				'String',
71
+				'name',
72
+				esc_html__('State Name', 'event_espresso')
73
+			),
74
+			new GraphQLField(
75
+				'isActive',
76
+				'Boolean',
77
+				'active',
78
+				esc_html__('State Active Flag', 'event_espresso')
79
+			),
80
+			new GraphQLOutputField(
81
+				'country',
82
+				$this->namespace . 'Country',
83
+				null,
84
+				esc_html__('Country for the state', 'event_espresso')
85
+			),
86
+			new GraphQLInputField(
87
+				'country',
88
+				'String',
89
+				null,
90
+				esc_html__('Country ISO Code', 'event_espresso')
91
+			),
92
+		];
93 93
 
94
-        return apply_filters(
95
-            'FHEE__EventEspresso_core_domain_services_graphql_types__state_fields',
96
-            $fields,
97
-            $this->name,
98
-            $this->model
99
-        );
100
-    }
94
+		return apply_filters(
95
+			'FHEE__EventEspresso_core_domain_services_graphql_types__state_fields',
96
+			$fields,
97
+			$this->name,
98
+			$this->model
99
+		);
100
+	}
101 101
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/types/Price.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function __construct(EEM_Price $price_model)
35 35
     {
36
-        $this->setName($this->namespace . 'Price');
36
+        $this->setName($this->namespace.'Price');
37 37
         $this->setDescription(__('A price.', 'event_espresso'));
38 38
         $this->setIsCustomPostType(false);
39 39
         parent::__construct($price_model);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             ),
146 146
             new GraphQLOutputField(
147 147
                 'priceType',
148
-                $this->namespace . 'PriceType',
148
+                $this->namespace.'PriceType',
149 149
                 'type_obj',
150 150
                 esc_html__('The related price type object.', 'event_espresso')
151 151
             ),
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     {
196 196
         // Register mutation to update an entity.
197 197
         register_graphql_mutation(
198
-            'update' . $this->name(),
198
+            'update'.$this->name(),
199 199
             [
200 200
                 'inputFields'         => $inputFields,
201 201
                 'outputFields'        => [
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         );
210 210
         // Register mutation to delete an entity.
211 211
         register_graphql_mutation(
212
-            'delete' . $this->name(),
212
+            'delete'.$this->name(),
213 213
             [
214 214
                 'inputFields'         => [
215 215
                     'id'                => $inputFields['id'],
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                     lcfirst($this->name()) => [
223 223
                         'type'        => $this->name(),
224 224
                         'description' => esc_html__('The object before it was deleted', 'event_espresso'),
225
-                        'resolve'     => static function ($payload) {
225
+                        'resolve'     => static function($payload) {
226 226
                             $deleted = (object) $payload['deleted'];
227 227
 
228 228
                             return ! empty($deleted) ? $deleted : null;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         unset($inputFields['id']);
238 238
         // Register mutation to update an entity.
239 239
         register_graphql_mutation(
240
-            'create' . $this->name(),
240
+            'create'.$this->name(),
241 241
             [
242 242
                 'inputFields'         => $inputFields,
243 243
                 'outputFields'        => [
Please login to merge, or discard this patch.
Indentation   +217 added lines, -217 removed lines patch added patch discarded remove patch
@@ -26,228 +26,228 @@
 block discarded – undo
26 26
  */
27 27
 class Price extends TypeBase
28 28
 {
29
-    /**
30
-     * Price constructor.
31
-     *
32
-     * @param EEM_Price $price_model
33
-     */
34
-    public function __construct(EEM_Price $price_model)
35
-    {
36
-        $this->setName($this->namespace . 'Price');
37
-        $this->setDescription(__('A price.', 'event_espresso'));
38
-        $this->setIsCustomPostType(false);
39
-        parent::__construct($price_model);
40
-    }
29
+	/**
30
+	 * Price constructor.
31
+	 *
32
+	 * @param EEM_Price $price_model
33
+	 */
34
+	public function __construct(EEM_Price $price_model)
35
+	{
36
+		$this->setName($this->namespace . 'Price');
37
+		$this->setDescription(__('A price.', 'event_espresso'));
38
+		$this->setIsCustomPostType(false);
39
+		parent::__construct($price_model);
40
+	}
41 41
 
42 42
 
43
-    /**
44
-     * @return GraphQLFieldInterface[]
45
-     * @since $VID:$
46
-     */
47
-    public function getFields()
48
-    {
49
-        $fields = [
50
-            new GraphQLField(
51
-                'id',
52
-                ['non_null' => 'ID'],
53
-                null,
54
-                esc_html__('The globally unique ID for the object.', 'event_espresso')
55
-            ),
56
-            new GraphQLOutputField(
57
-                'dbId',
58
-                ['non_null' => 'Int'],
59
-                'ID',
60
-                esc_html__('Price ID', 'event_espresso')
61
-            ),
62
-            new GraphQLField(
63
-                'amount',
64
-                'Float',
65
-                'amount',
66
-                esc_html__('Price Amount', 'event_espresso')
67
-            ),
68
-            new GraphQLOutputField(
69
-                'cacheId',
70
-                ['non_null' => 'String'],
71
-                null,
72
-                esc_html__('The cache ID of the object.', 'event_espresso')
73
-            ),
74
-            new GraphQLField(
75
-                'description',
76
-                'String',
77
-                'desc',
78
-                esc_html__('Price description', 'event_espresso')
79
-            ),
80
-            new GraphQLOutputField(
81
-                'isBasePrice',
82
-                'Boolean',
83
-                'is_base_price',
84
-                esc_html__('Flag indicating price is a base price type.', 'event_espresso')
85
-            ),
86
-            new GraphQLField(
87
-                'isDefault',
88
-                'Boolean',
89
-                'is_default',
90
-                esc_html__('Flag indicating price is the default one.', 'event_espresso')
91
-            ),
92
-            new GraphQLOutputField(
93
-                'isDiscount',
94
-                'Boolean',
95
-                'is_discount',
96
-                esc_html__('Flag indicating price is a discount.', 'event_espresso')
97
-            ),
98
-            new GraphQLOutputField(
99
-                'isPercent',
100
-                'Boolean',
101
-                'is_percent',
102
-                esc_html__('Flag indicating price is a percentage.', 'event_espresso')
103
-            ),
104
-            new GraphQLOutputField(
105
-                'isTax',
106
-                'Boolean',
107
-                'is_tax',
108
-                esc_html__('Flag indicating price is a tax.', 'event_espresso')
109
-            ),
110
-            new GraphQLField(
111
-                'isTrashed',
112
-                'Boolean',
113
-                'deleted',
114
-                esc_html__('Flag indicating price has been trashed.', 'event_espresso')
115
-            ),
116
-            new GraphQLField(
117
-                'name',
118
-                'String',
119
-                'name',
120
-                esc_html__('Price Name', 'event_espresso')
121
-            ),
122
-            new GraphQLField(
123
-                'order',
124
-                'Int',
125
-                'order',
126
-                esc_html__('Order of Application of Price.', 'event_espresso')
127
-            ),
128
-            new GraphQLField(
129
-                'overrides',
130
-                'Int',
131
-                'overrides',
132
-                esc_html__('Price ID for a global Price that will be overridden by this Price.', 'event_espresso')
133
-            ),
134
-            new GraphQLOutputField(
135
-                'parent',
136
-                $this->name(),
137
-                null,
138
-                esc_html__('The parent price of the current price', 'event_espresso')
139
-            ),
140
-            new GraphQLInputField(
141
-                'parent',
142
-                'ID',
143
-                null,
144
-                esc_html__('The parent price ID', 'event_espresso')
145
-            ),
146
-            new GraphQLOutputField(
147
-                'priceType',
148
-                $this->namespace . 'PriceType',
149
-                'type_obj',
150
-                esc_html__('The related price type object.', 'event_espresso')
151
-            ),
152
-            new GraphQLInputField(
153
-                'priceType',
154
-                'ID',
155
-                null,
156
-                esc_html__('The price type ID', 'event_espresso')
157
-            ),
158
-            new GraphQLOutputField(
159
-                'wpUser',
160
-                'User',
161
-                null,
162
-                esc_html__('Price Creator', 'event_espresso')
163
-            ),
164
-            new GraphQLOutputField(
165
-                'userId',
166
-                'ID',
167
-                null,
168
-                esc_html__('Price Creator ID', 'event_espresso')
169
-            ),
170
-            new GraphQLInputField(
171
-                'wpUser',
172
-                'Int',
173
-                null,
174
-                esc_html__('Price Creator ID', 'event_espresso')
175
-            ),
176
-        ];
43
+	/**
44
+	 * @return GraphQLFieldInterface[]
45
+	 * @since $VID:$
46
+	 */
47
+	public function getFields()
48
+	{
49
+		$fields = [
50
+			new GraphQLField(
51
+				'id',
52
+				['non_null' => 'ID'],
53
+				null,
54
+				esc_html__('The globally unique ID for the object.', 'event_espresso')
55
+			),
56
+			new GraphQLOutputField(
57
+				'dbId',
58
+				['non_null' => 'Int'],
59
+				'ID',
60
+				esc_html__('Price ID', 'event_espresso')
61
+			),
62
+			new GraphQLField(
63
+				'amount',
64
+				'Float',
65
+				'amount',
66
+				esc_html__('Price Amount', 'event_espresso')
67
+			),
68
+			new GraphQLOutputField(
69
+				'cacheId',
70
+				['non_null' => 'String'],
71
+				null,
72
+				esc_html__('The cache ID of the object.', 'event_espresso')
73
+			),
74
+			new GraphQLField(
75
+				'description',
76
+				'String',
77
+				'desc',
78
+				esc_html__('Price description', 'event_espresso')
79
+			),
80
+			new GraphQLOutputField(
81
+				'isBasePrice',
82
+				'Boolean',
83
+				'is_base_price',
84
+				esc_html__('Flag indicating price is a base price type.', 'event_espresso')
85
+			),
86
+			new GraphQLField(
87
+				'isDefault',
88
+				'Boolean',
89
+				'is_default',
90
+				esc_html__('Flag indicating price is the default one.', 'event_espresso')
91
+			),
92
+			new GraphQLOutputField(
93
+				'isDiscount',
94
+				'Boolean',
95
+				'is_discount',
96
+				esc_html__('Flag indicating price is a discount.', 'event_espresso')
97
+			),
98
+			new GraphQLOutputField(
99
+				'isPercent',
100
+				'Boolean',
101
+				'is_percent',
102
+				esc_html__('Flag indicating price is a percentage.', 'event_espresso')
103
+			),
104
+			new GraphQLOutputField(
105
+				'isTax',
106
+				'Boolean',
107
+				'is_tax',
108
+				esc_html__('Flag indicating price is a tax.', 'event_espresso')
109
+			),
110
+			new GraphQLField(
111
+				'isTrashed',
112
+				'Boolean',
113
+				'deleted',
114
+				esc_html__('Flag indicating price has been trashed.', 'event_espresso')
115
+			),
116
+			new GraphQLField(
117
+				'name',
118
+				'String',
119
+				'name',
120
+				esc_html__('Price Name', 'event_espresso')
121
+			),
122
+			new GraphQLField(
123
+				'order',
124
+				'Int',
125
+				'order',
126
+				esc_html__('Order of Application of Price.', 'event_espresso')
127
+			),
128
+			new GraphQLField(
129
+				'overrides',
130
+				'Int',
131
+				'overrides',
132
+				esc_html__('Price ID for a global Price that will be overridden by this Price.', 'event_espresso')
133
+			),
134
+			new GraphQLOutputField(
135
+				'parent',
136
+				$this->name(),
137
+				null,
138
+				esc_html__('The parent price of the current price', 'event_espresso')
139
+			),
140
+			new GraphQLInputField(
141
+				'parent',
142
+				'ID',
143
+				null,
144
+				esc_html__('The parent price ID', 'event_espresso')
145
+			),
146
+			new GraphQLOutputField(
147
+				'priceType',
148
+				$this->namespace . 'PriceType',
149
+				'type_obj',
150
+				esc_html__('The related price type object.', 'event_espresso')
151
+			),
152
+			new GraphQLInputField(
153
+				'priceType',
154
+				'ID',
155
+				null,
156
+				esc_html__('The price type ID', 'event_espresso')
157
+			),
158
+			new GraphQLOutputField(
159
+				'wpUser',
160
+				'User',
161
+				null,
162
+				esc_html__('Price Creator', 'event_espresso')
163
+			),
164
+			new GraphQLOutputField(
165
+				'userId',
166
+				'ID',
167
+				null,
168
+				esc_html__('Price Creator ID', 'event_espresso')
169
+			),
170
+			new GraphQLInputField(
171
+				'wpUser',
172
+				'Int',
173
+				null,
174
+				esc_html__('Price Creator ID', 'event_espresso')
175
+			),
176
+		];
177 177
 
178
-        return apply_filters(
179
-            'FHEE__EventEspresso_core_domain_services_graphql_types__price_fields',
180
-            $fields,
181
-            $this->name,
182
-            $this->model
183
-        );
184
-    }
178
+		return apply_filters(
179
+			'FHEE__EventEspresso_core_domain_services_graphql_types__price_fields',
180
+			$fields,
181
+			$this->name,
182
+			$this->model
183
+		);
184
+	}
185 185
 
186 186
 
187
-    /**
188
-     * @param array $inputFields The mutation input fields.
189
-     * @throws InvalidArgumentException
190
-     * @throws ReflectionException
191
-     * @throws Exception
192
-     * @since $VID:$
193
-     */
194
-    public function registerMutations($inputFields)
195
-    {
196
-        // Register mutation to update an entity.
197
-        register_graphql_mutation(
198
-            'update' . $this->name(),
199
-            [
200
-                'inputFields'         => $inputFields,
201
-                'outputFields'        => [
202
-                    lcfirst($this->name()) => [
203
-                        'type'    => $this->name(),
204
-                        'resolve' => [$this, 'resolveFromPayload'],
205
-                    ],
206
-                ],
207
-                'mutateAndGetPayload' => PriceUpdate::mutateAndGetPayload($this->model, $this),
208
-            ]
209
-        );
210
-        // Register mutation to delete an entity.
211
-        register_graphql_mutation(
212
-            'delete' . $this->name(),
213
-            [
214
-                'inputFields'         => [
215
-                    'id'                => $inputFields['id'],
216
-                    'deletePermanently' => [
217
-                        'type'        => 'Boolean',
218
-                        'description' => esc_html__('Whether to delete the entity permanently.', 'event_espresso'),
219
-                    ],
220
-                ],
221
-                'outputFields'        => [
222
-                    lcfirst($this->name()) => [
223
-                        'type'        => $this->name(),
224
-                        'description' => esc_html__('The object before it was deleted', 'event_espresso'),
225
-                        'resolve'     => static function ($payload) {
226
-                            $deleted = (object) $payload['deleted'];
187
+	/**
188
+	 * @param array $inputFields The mutation input fields.
189
+	 * @throws InvalidArgumentException
190
+	 * @throws ReflectionException
191
+	 * @throws Exception
192
+	 * @since $VID:$
193
+	 */
194
+	public function registerMutations($inputFields)
195
+	{
196
+		// Register mutation to update an entity.
197
+		register_graphql_mutation(
198
+			'update' . $this->name(),
199
+			[
200
+				'inputFields'         => $inputFields,
201
+				'outputFields'        => [
202
+					lcfirst($this->name()) => [
203
+						'type'    => $this->name(),
204
+						'resolve' => [$this, 'resolveFromPayload'],
205
+					],
206
+				],
207
+				'mutateAndGetPayload' => PriceUpdate::mutateAndGetPayload($this->model, $this),
208
+			]
209
+		);
210
+		// Register mutation to delete an entity.
211
+		register_graphql_mutation(
212
+			'delete' . $this->name(),
213
+			[
214
+				'inputFields'         => [
215
+					'id'                => $inputFields['id'],
216
+					'deletePermanently' => [
217
+						'type'        => 'Boolean',
218
+						'description' => esc_html__('Whether to delete the entity permanently.', 'event_espresso'),
219
+					],
220
+				],
221
+				'outputFields'        => [
222
+					lcfirst($this->name()) => [
223
+						'type'        => $this->name(),
224
+						'description' => esc_html__('The object before it was deleted', 'event_espresso'),
225
+						'resolve'     => static function ($payload) {
226
+							$deleted = (object) $payload['deleted'];
227 227
 
228
-                            return ! empty($deleted) ? $deleted : null;
229
-                        },
230
-                    ],
231
-                ],
232
-                'mutateAndGetPayload' => PriceDelete::mutateAndGetPayload($this->model, $this),
233
-            ]
234
-        );
228
+							return ! empty($deleted) ? $deleted : null;
229
+						},
230
+					],
231
+				],
232
+				'mutateAndGetPayload' => PriceDelete::mutateAndGetPayload($this->model, $this),
233
+			]
234
+		);
235 235
 
236
-        // remove primary key from input.
237
-        unset($inputFields['id']);
238
-        // Register mutation to update an entity.
239
-        register_graphql_mutation(
240
-            'create' . $this->name(),
241
-            [
242
-                'inputFields'         => $inputFields,
243
-                'outputFields'        => [
244
-                    lcfirst($this->name()) => [
245
-                        'type'    => $this->name(),
246
-                        'resolve' => [$this, 'resolveFromPayload'],
247
-                    ],
248
-                ],
249
-                'mutateAndGetPayload' => PriceCreate::mutateAndGetPayload($this->model, $this),
250
-            ]
251
-        );
252
-    }
236
+		// remove primary key from input.
237
+		unset($inputFields['id']);
238
+		// Register mutation to update an entity.
239
+		register_graphql_mutation(
240
+			'create' . $this->name(),
241
+			[
242
+				'inputFields'         => $inputFields,
243
+				'outputFields'        => [
244
+					lcfirst($this->name()) => [
245
+						'type'    => $this->name(),
246
+						'resolve' => [$this, 'resolveFromPayload'],
247
+					],
248
+				],
249
+				'mutateAndGetPayload' => PriceCreate::mutateAndGetPayload($this->model, $this),
250
+			]
251
+		);
252
+	}
253 253
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/types/Venue.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function __construct(EEM_Venue $venue_model)
30 30
     {
31
-        $this->setName($this->namespace . 'Venue');
31
+        $this->setName($this->namespace.'Venue');
32 32
         $this->setIsCustomPostType(true);
33 33
         parent::__construct($venue_model);
34 34
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             ),
121 121
             new GraphQLOutputField(
122 122
                 'state',
123
-                $this->namespace . 'State',
123
+                $this->namespace.'State',
124 124
                 null,
125 125
                 esc_html__('Venue state', 'event_espresso')
126 126
             ),
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             ),
133 133
             new GraphQLOutputField(
134 134
                 'country',
135
-                $this->namespace . 'Country',
135
+                $this->namespace.'Country',
136 136
                 null,
137 137
                 esc_html__('Venue country', 'event_espresso')
138 138
             ),
Please login to merge, or discard this patch.
Indentation   +235 added lines, -235 removed lines patch added patch discarded remove patch
@@ -26,246 +26,246 @@
 block discarded – undo
26 26
  */
27 27
 class Venue extends TypeBase
28 28
 {
29
-    /**
30
-     * Venue constructor.
31
-     *
32
-     * @param EEM_Venue $venue_model
33
-     */
34
-    public function __construct(EEM_Venue $venue_model)
35
-    {
36
-        $this->setName($this->namespace . 'Venue');
37
-        $this->setIsCustomPostType(true);
38
-        parent::__construct($venue_model);
39
-    }
29
+	/**
30
+	 * Venue constructor.
31
+	 *
32
+	 * @param EEM_Venue $venue_model
33
+	 */
34
+	public function __construct(EEM_Venue $venue_model)
35
+	{
36
+		$this->setName($this->namespace . 'Venue');
37
+		$this->setIsCustomPostType(true);
38
+		parent::__construct($venue_model);
39
+	}
40 40
 
41 41
 
42
-    /**
43
-     * @return GraphQLFieldInterface[]
44
-     */
45
-    public function getFields()
46
-    {
47
-        $fields = [
48
-            new GraphQLOutputField(
49
-                'dbId',
50
-                ['non_null' => 'Int'],
51
-                'ID',
52
-                esc_html__('The venue ID.', 'event_espresso')
53
-            ),
54
-            new GraphQLOutputField(
55
-                'cacheId',
56
-                ['non_null' => 'String'],
57
-                null,
58
-                esc_html__('The cache ID of the object.', 'event_espresso')
59
-            ),
60
-            new GraphQLField(
61
-                'name',
62
-                'String',
63
-                'name',
64
-                esc_html__('Venue Name', 'event_espresso')
65
-            ),
66
-            new GraphQLField(
67
-                'description',
68
-                'String',
69
-                'description',
70
-                esc_html__('Venue Description', 'event_espresso')
71
-            ),
72
-            new GraphQLField(
73
-                'shortDescription',
74
-                'String',
75
-                'excerpt',
76
-                esc_html__('Short Description of Venue', 'event_espresso')
77
-            ),
78
-            new GraphQLField(
79
-                'identifier',
80
-                'String',
81
-                'identifier',
82
-                esc_html__('Venue Identifier', 'event_espresso')
83
-            ),
84
-            new GraphQLField(
85
-                'created',
86
-                'String',
87
-                'created',
88
-                esc_html__('Date Venue Created', 'event_espresso')
89
-            ),
90
-            new GraphQLField(
91
-                'order',
92
-                'Int',
93
-                'order',
94
-                esc_html__('Venue order', 'event_espresso')
95
-            ),
96
-            new GraphQLOutputField(
97
-                'wpUser',
98
-                'User',
99
-                null,
100
-                esc_html__('Venue Creator', 'event_espresso')
101
-            ),
102
-            new GraphQLInputField(
103
-                'wpUser',
104
-                'Int',
105
-                null,
106
-                esc_html__('Venue Creator ID', 'event_espresso')
107
-            ),
108
-            new GraphQLField(
109
-                'address',
110
-                'String',
111
-                'address',
112
-                esc_html__('Venue Address line 1', 'event_espresso')
113
-            ),
114
-            new GraphQLField(
115
-                'address2',
116
-                'String',
117
-                'address2',
118
-                esc_html__('Venue Address line 2', 'event_espresso')
119
-            ),
120
-            new GraphQLField(
121
-                'city',
122
-                'String',
123
-                'city',
124
-                esc_html__('Venue City', 'event_espresso')
125
-            ),
126
-            new GraphQLOutputField(
127
-                'state',
128
-                $this->namespace . 'State',
129
-                null,
130
-                esc_html__('Venue state', 'event_espresso')
131
-            ),
132
-            new GraphQLOutputField(
133
-                'stateName',
134
-                'String',
135
-                'state_name',
136
-                esc_html__('Venue state name', 'event_espresso')
137
-            ),
138
-            new GraphQLOutputField(
139
-                'stateAbbrev',
140
-                'String',
141
-                'state_abbrev',
142
-                esc_html__('Venue state abbreviation', 'event_espresso')
143
-            ),
144
-            new GraphQLInputField(
145
-                'state',
146
-                'Int',
147
-                null,
148
-                esc_html__('State ID', 'event_espresso')
149
-            ),
150
-            new GraphQLOutputField(
151
-                'country',
152
-                $this->namespace . 'Country',
153
-                null,
154
-                esc_html__('Venue country', 'event_espresso')
155
-            ),
156
-            new GraphQLOutputField(
157
-                'countryName',
158
-                'String',
159
-                'country_name',
160
-                esc_html__('Venue country name', 'event_espresso')
161
-            ),
162
-            new GraphQLOutputField(
163
-                'countryISO',
164
-                'String',
165
-                'country_ID',
166
-                esc_html__('Venue Country ISO Code', 'event_espresso')
167
-            ),
168
-            new GraphQLInputField(
169
-                'country',
170
-                'String',
171
-                null,
172
-                esc_html__('Country ISO Code', 'event_espresso')
173
-            ),
174
-            new GraphQLField(
175
-                'zip',
176
-                'String',
177
-                'zip',
178
-                esc_html__('Venue Zip/Postal Code', 'event_espresso')
179
-            ),
180
-            new GraphQLField(
181
-                'capacity',
182
-                'Int',
183
-                'capacity',
184
-                esc_html__('Venue Capacity', 'event_espresso'),
185
-                [$this, 'parseInfiniteValue']
186
-            ),
187
-            new GraphQLField(
188
-                'phone',
189
-                'String',
190
-                'phone',
191
-                esc_html__('Venue Phone', 'event_espresso')
192
-            ),
193
-            new GraphQLField(
194
-                'virtualPhone',
195
-                'String',
196
-                'virtual_phone',
197
-                esc_html__('Call in Number', 'event_espresso')
198
-            ),
199
-            new GraphQLField(
200
-                'url',
201
-                'String',
202
-                'venue_url',
203
-                esc_html__('Venue Website', 'event_espresso')
204
-            ),
205
-            new GraphQLField(
206
-                'virtualUrl',
207
-                'String',
208
-                'virtual_url',
209
-                esc_html__('Virtual URL', 'event_espresso')
210
-            ),
211
-            new GraphQLField(
212
-                'googleMapLink',
213
-                'String',
214
-                'google_map_link',
215
-                esc_html__('Google Map Link', 'event_espresso')
216
-            ),
217
-            new GraphQLField(
218
-                'enableForGmap',
219
-                'String',
220
-                'enable_for_gmap',
221
-                esc_html__('Show Google Map?', 'event_espresso')
222
-            ),
223
-            new GraphQLOutputField(
224
-                'thumbnail',
225
-                'String',
226
-                'thumbnail',
227
-                esc_html__('Venue Thumbnail', 'event_espresso'),
228
-                null,
229
-                [$this, 'getThumbnail']
230
-            ),
231
-        ];
42
+	/**
43
+	 * @return GraphQLFieldInterface[]
44
+	 */
45
+	public function getFields()
46
+	{
47
+		$fields = [
48
+			new GraphQLOutputField(
49
+				'dbId',
50
+				['non_null' => 'Int'],
51
+				'ID',
52
+				esc_html__('The venue ID.', 'event_espresso')
53
+			),
54
+			new GraphQLOutputField(
55
+				'cacheId',
56
+				['non_null' => 'String'],
57
+				null,
58
+				esc_html__('The cache ID of the object.', 'event_espresso')
59
+			),
60
+			new GraphQLField(
61
+				'name',
62
+				'String',
63
+				'name',
64
+				esc_html__('Venue Name', 'event_espresso')
65
+			),
66
+			new GraphQLField(
67
+				'description',
68
+				'String',
69
+				'description',
70
+				esc_html__('Venue Description', 'event_espresso')
71
+			),
72
+			new GraphQLField(
73
+				'shortDescription',
74
+				'String',
75
+				'excerpt',
76
+				esc_html__('Short Description of Venue', 'event_espresso')
77
+			),
78
+			new GraphQLField(
79
+				'identifier',
80
+				'String',
81
+				'identifier',
82
+				esc_html__('Venue Identifier', 'event_espresso')
83
+			),
84
+			new GraphQLField(
85
+				'created',
86
+				'String',
87
+				'created',
88
+				esc_html__('Date Venue Created', 'event_espresso')
89
+			),
90
+			new GraphQLField(
91
+				'order',
92
+				'Int',
93
+				'order',
94
+				esc_html__('Venue order', 'event_espresso')
95
+			),
96
+			new GraphQLOutputField(
97
+				'wpUser',
98
+				'User',
99
+				null,
100
+				esc_html__('Venue Creator', 'event_espresso')
101
+			),
102
+			new GraphQLInputField(
103
+				'wpUser',
104
+				'Int',
105
+				null,
106
+				esc_html__('Venue Creator ID', 'event_espresso')
107
+			),
108
+			new GraphQLField(
109
+				'address',
110
+				'String',
111
+				'address',
112
+				esc_html__('Venue Address line 1', 'event_espresso')
113
+			),
114
+			new GraphQLField(
115
+				'address2',
116
+				'String',
117
+				'address2',
118
+				esc_html__('Venue Address line 2', 'event_espresso')
119
+			),
120
+			new GraphQLField(
121
+				'city',
122
+				'String',
123
+				'city',
124
+				esc_html__('Venue City', 'event_espresso')
125
+			),
126
+			new GraphQLOutputField(
127
+				'state',
128
+				$this->namespace . 'State',
129
+				null,
130
+				esc_html__('Venue state', 'event_espresso')
131
+			),
132
+			new GraphQLOutputField(
133
+				'stateName',
134
+				'String',
135
+				'state_name',
136
+				esc_html__('Venue state name', 'event_espresso')
137
+			),
138
+			new GraphQLOutputField(
139
+				'stateAbbrev',
140
+				'String',
141
+				'state_abbrev',
142
+				esc_html__('Venue state abbreviation', 'event_espresso')
143
+			),
144
+			new GraphQLInputField(
145
+				'state',
146
+				'Int',
147
+				null,
148
+				esc_html__('State ID', 'event_espresso')
149
+			),
150
+			new GraphQLOutputField(
151
+				'country',
152
+				$this->namespace . 'Country',
153
+				null,
154
+				esc_html__('Venue country', 'event_espresso')
155
+			),
156
+			new GraphQLOutputField(
157
+				'countryName',
158
+				'String',
159
+				'country_name',
160
+				esc_html__('Venue country name', 'event_espresso')
161
+			),
162
+			new GraphQLOutputField(
163
+				'countryISO',
164
+				'String',
165
+				'country_ID',
166
+				esc_html__('Venue Country ISO Code', 'event_espresso')
167
+			),
168
+			new GraphQLInputField(
169
+				'country',
170
+				'String',
171
+				null,
172
+				esc_html__('Country ISO Code', 'event_espresso')
173
+			),
174
+			new GraphQLField(
175
+				'zip',
176
+				'String',
177
+				'zip',
178
+				esc_html__('Venue Zip/Postal Code', 'event_espresso')
179
+			),
180
+			new GraphQLField(
181
+				'capacity',
182
+				'Int',
183
+				'capacity',
184
+				esc_html__('Venue Capacity', 'event_espresso'),
185
+				[$this, 'parseInfiniteValue']
186
+			),
187
+			new GraphQLField(
188
+				'phone',
189
+				'String',
190
+				'phone',
191
+				esc_html__('Venue Phone', 'event_espresso')
192
+			),
193
+			new GraphQLField(
194
+				'virtualPhone',
195
+				'String',
196
+				'virtual_phone',
197
+				esc_html__('Call in Number', 'event_espresso')
198
+			),
199
+			new GraphQLField(
200
+				'url',
201
+				'String',
202
+				'venue_url',
203
+				esc_html__('Venue Website', 'event_espresso')
204
+			),
205
+			new GraphQLField(
206
+				'virtualUrl',
207
+				'String',
208
+				'virtual_url',
209
+				esc_html__('Virtual URL', 'event_espresso')
210
+			),
211
+			new GraphQLField(
212
+				'googleMapLink',
213
+				'String',
214
+				'google_map_link',
215
+				esc_html__('Google Map Link', 'event_espresso')
216
+			),
217
+			new GraphQLField(
218
+				'enableForGmap',
219
+				'String',
220
+				'enable_for_gmap',
221
+				esc_html__('Show Google Map?', 'event_espresso')
222
+			),
223
+			new GraphQLOutputField(
224
+				'thumbnail',
225
+				'String',
226
+				'thumbnail',
227
+				esc_html__('Venue Thumbnail', 'event_espresso'),
228
+				null,
229
+				[$this, 'getThumbnail']
230
+			),
231
+		];
232 232
 
233
-        return apply_filters(
234
-            'FHEE__EventEspresso_core_domain_services_graphql_types__venue_fields',
235
-            $fields,
236
-            $this->name,
237
-            $this->model
238
-        );
239
-    }
233
+		return apply_filters(
234
+			'FHEE__EventEspresso_core_domain_services_graphql_types__venue_fields',
235
+			$fields,
236
+			$this->name,
237
+			$this->model
238
+		);
239
+	}
240 240
 
241 241
 
242
-    /**
243
-     * Extends the existing WP GraphQL mutations.
244
-     *
245
-     * @return void
246
-     */
247
-    public function extendMutations()
248
-    {
249
-        add_action(
250
-            'graphql_post_object_mutation_update_additional_data',
251
-            VenueUpdate::mutateFields($this->model, $this),
252
-            10,
253
-            6
254
-        );
255
-    }
242
+	/**
243
+	 * Extends the existing WP GraphQL mutations.
244
+	 *
245
+	 * @return void
246
+	 */
247
+	public function extendMutations()
248
+	{
249
+		add_action(
250
+			'graphql_post_object_mutation_update_additional_data',
251
+			VenueUpdate::mutateFields($this->model, $this),
252
+			10,
253
+			6
254
+		);
255
+	}
256 256
 
257 257
 
258
-    /**
259
-     * @param EE_Venue    $venue
260
-     * @param array       $args
261
-     * @param \WPGraphQL\AppContext $context
262
-     * @param \GraphQL\Type\Definition\ResolveInfo $info
263
-     * @return string
264
-     * @throws EE_Error
265
-     * @throws ReflectionException
266
-     */
267
-    public function getThumbnail($venue, $args, $context, $info)
268
-    {
269
-        return wp_get_attachment_url(get_post_thumbnail_id($venue->ID()));
270
-    }
258
+	/**
259
+	 * @param EE_Venue    $venue
260
+	 * @param array       $args
261
+	 * @param \WPGraphQL\AppContext $context
262
+	 * @param \GraphQL\Type\Definition\ResolveInfo $info
263
+	 * @return string
264
+	 * @throws EE_Error
265
+	 * @throws ReflectionException
266
+	 */
267
+	public function getThumbnail($venue, $args, $context, $info)
268
+	{
269
+		return wp_get_attachment_url(get_post_thumbnail_id($venue->ID()));
270
+	}
271 271
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/types/PriceType.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function __construct(EEM_Price_Type $price_type_model)
29 29
     {
30
-        $this->setName($this->namespace . 'PriceType');
30
+        $this->setName($this->namespace.'PriceType');
31 31
         $this->setDescription(__('A price type.', 'event_espresso'));
32 32
         $this->setIsCustomPostType(false);
33 33
         parent::__construct($price_type_model);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             ),
55 55
             new GraphQLField(
56 56
                 'baseType',
57
-                $this->namespace . 'PriceBaseTypeEnum',
57
+                $this->namespace.'PriceBaseTypeEnum',
58 58
                 'base_type',
59 59
                 esc_html__('Price Base type', 'event_espresso')
60 60
             ),
Please login to merge, or discard this patch.
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -20,117 +20,117 @@
 block discarded – undo
20 20
  */
21 21
 class PriceType extends TypeBase
22 22
 {
23
-    /**
24
-     * PriceType constructor.
25
-     *
26
-     * @param EEM_Price_Type $price_type_model
27
-     */
28
-    public function __construct(EEM_Price_Type $price_type_model)
29
-    {
30
-        $this->setName($this->namespace . 'PriceType');
31
-        $this->setDescription(__('A price type.', 'event_espresso'));
32
-        $this->setIsCustomPostType(false);
33
-        parent::__construct($price_type_model);
34
-    }
23
+	/**
24
+	 * PriceType constructor.
25
+	 *
26
+	 * @param EEM_Price_Type $price_type_model
27
+	 */
28
+	public function __construct(EEM_Price_Type $price_type_model)
29
+	{
30
+		$this->setName($this->namespace . 'PriceType');
31
+		$this->setDescription(__('A price type.', 'event_espresso'));
32
+		$this->setIsCustomPostType(false);
33
+		parent::__construct($price_type_model);
34
+	}
35 35
 
36 36
 
37
-    /**
38
-     * @return GraphQLFieldInterface[]
39
-     */
40
-    public function getFields()
41
-    {
42
-        $fields = [
43
-            new GraphQLField(
44
-                'id',
45
-                ['non_null' => 'ID'],
46
-                null,
47
-                esc_html__('The globally unique ID for the object.', 'event_espresso')
48
-            ),
49
-            new GraphQLOutputField(
50
-                'dbId',
51
-                ['non_null' => 'Int'],
52
-                'ID',
53
-                esc_html__('Price type ID', 'event_espresso')
54
-            ),
55
-            new GraphQLField(
56
-                'baseType',
57
-                $this->namespace . 'PriceBaseTypeEnum',
58
-                'base_type',
59
-                esc_html__('Price Base type', 'event_espresso')
60
-            ),
61
-            new GraphQLOutputField(
62
-                'cacheId',
63
-                ['non_null' => 'String'],
64
-                null,
65
-                esc_html__('The cache ID of the object.', 'event_espresso')
66
-            ),
67
-            new GraphQLField(
68
-                'isBasePrice',
69
-                'Boolean',
70
-                'is_base_price',
71
-                esc_html__('Flag indicating price type is a base price.', 'event_espresso')
72
-            ),
73
-            new GraphQLField(
74
-                'isTrashed',
75
-                'Boolean',
76
-                'deleted',
77
-                esc_html__('Flag indicating price type has been trashed.', 'event_espresso')
78
-            ),
79
-            new GraphQLOutputField(
80
-                'isDiscount',
81
-                'Boolean',
82
-                'is_discount',
83
-                esc_html__('Flag indicating price type is a discount.', 'event_espresso')
84
-            ),
85
-            new GraphQLField(
86
-                'isPercent',
87
-                'Boolean',
88
-                'is_percent',
89
-                esc_html__('Flag indicating price type is a percentage.', 'event_espresso')
90
-            ),
91
-            new GraphQLOutputField(
92
-                'isTax',
93
-                'Boolean',
94
-                'is_tax',
95
-                esc_html__('Flag indicating price is a tax.', 'event_espresso')
96
-            ),
97
-            new GraphQLField(
98
-                'name',
99
-                'String',
100
-                'name',
101
-                esc_html__('Price type Name', 'event_espresso')
102
-            ),
103
-            new GraphQLField(
104
-                'order',
105
-                'Int',
106
-                'order',
107
-                esc_html__('Order in which price should be applied.', 'event_espresso')
108
-            ),
109
-            new GraphQLOutputField(
110
-                'wpUser',
111
-                'User',
112
-                null,
113
-                esc_html__('Price Type Creator', 'event_espresso')
114
-            ),
115
-            new GraphQLOutputField(
116
-                'userId',
117
-                'ID',
118
-                null,
119
-                esc_html__('Price Type Creator ID', 'event_espresso')
120
-            ),
121
-            new GraphQLInputField(
122
-                'wpUser',
123
-                'Int',
124
-                null,
125
-                esc_html__('Price Type Creator ID', 'event_espresso')
126
-            ),
127
-        ];
37
+	/**
38
+	 * @return GraphQLFieldInterface[]
39
+	 */
40
+	public function getFields()
41
+	{
42
+		$fields = [
43
+			new GraphQLField(
44
+				'id',
45
+				['non_null' => 'ID'],
46
+				null,
47
+				esc_html__('The globally unique ID for the object.', 'event_espresso')
48
+			),
49
+			new GraphQLOutputField(
50
+				'dbId',
51
+				['non_null' => 'Int'],
52
+				'ID',
53
+				esc_html__('Price type ID', 'event_espresso')
54
+			),
55
+			new GraphQLField(
56
+				'baseType',
57
+				$this->namespace . 'PriceBaseTypeEnum',
58
+				'base_type',
59
+				esc_html__('Price Base type', 'event_espresso')
60
+			),
61
+			new GraphQLOutputField(
62
+				'cacheId',
63
+				['non_null' => 'String'],
64
+				null,
65
+				esc_html__('The cache ID of the object.', 'event_espresso')
66
+			),
67
+			new GraphQLField(
68
+				'isBasePrice',
69
+				'Boolean',
70
+				'is_base_price',
71
+				esc_html__('Flag indicating price type is a base price.', 'event_espresso')
72
+			),
73
+			new GraphQLField(
74
+				'isTrashed',
75
+				'Boolean',
76
+				'deleted',
77
+				esc_html__('Flag indicating price type has been trashed.', 'event_espresso')
78
+			),
79
+			new GraphQLOutputField(
80
+				'isDiscount',
81
+				'Boolean',
82
+				'is_discount',
83
+				esc_html__('Flag indicating price type is a discount.', 'event_espresso')
84
+			),
85
+			new GraphQLField(
86
+				'isPercent',
87
+				'Boolean',
88
+				'is_percent',
89
+				esc_html__('Flag indicating price type is a percentage.', 'event_espresso')
90
+			),
91
+			new GraphQLOutputField(
92
+				'isTax',
93
+				'Boolean',
94
+				'is_tax',
95
+				esc_html__('Flag indicating price is a tax.', 'event_espresso')
96
+			),
97
+			new GraphQLField(
98
+				'name',
99
+				'String',
100
+				'name',
101
+				esc_html__('Price type Name', 'event_espresso')
102
+			),
103
+			new GraphQLField(
104
+				'order',
105
+				'Int',
106
+				'order',
107
+				esc_html__('Order in which price should be applied.', 'event_espresso')
108
+			),
109
+			new GraphQLOutputField(
110
+				'wpUser',
111
+				'User',
112
+				null,
113
+				esc_html__('Price Type Creator', 'event_espresso')
114
+			),
115
+			new GraphQLOutputField(
116
+				'userId',
117
+				'ID',
118
+				null,
119
+				esc_html__('Price Type Creator ID', 'event_espresso')
120
+			),
121
+			new GraphQLInputField(
122
+				'wpUser',
123
+				'Int',
124
+				null,
125
+				esc_html__('Price Type Creator ID', 'event_espresso')
126
+			),
127
+		];
128 128
 
129
-        return apply_filters(
130
-            'FHEE__EventEspresso_core_domain_services_graphql_types__priceType_fields',
131
-            $fields,
132
-            $this->name,
133
-            $this->model
134
-        );
135
-    }
129
+		return apply_filters(
130
+			'FHEE__EventEspresso_core_domain_services_graphql_types__priceType_fields',
131
+			$fields,
132
+			$this->name,
133
+			$this->model
134
+		);
135
+	}
136 136
 }
Please login to merge, or discard this patch.
core/domain/services/graphql/types/Country.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public function __construct(EEM_Country $country_model)
28 28
     {
29
-        $this->setName($this->namespace . 'Country');
29
+        $this->setName($this->namespace.'Country');
30 30
         $this->setDescription(__('A country', 'event_espresso'));
31 31
         $this->setIsCustomPostType(false);
32 32
         parent::__construct($country_model);
Please login to merge, or discard this patch.
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -19,120 +19,120 @@
 block discarded – undo
19 19
  */
20 20
 class Country extends TypeBase
21 21
 {
22
-    /**
23
-     * Country constructor.
24
-     *
25
-     * @param EEM_Country $country_model
26
-     */
27
-    public function __construct(EEM_Country $country_model)
28
-    {
29
-        $this->setName($this->namespace . 'Country');
30
-        $this->setDescription(__('A country', 'event_espresso'));
31
-        $this->setIsCustomPostType(false);
32
-        parent::__construct($country_model);
33
-    }
22
+	/**
23
+	 * Country constructor.
24
+	 *
25
+	 * @param EEM_Country $country_model
26
+	 */
27
+	public function __construct(EEM_Country $country_model)
28
+	{
29
+		$this->setName($this->namespace . 'Country');
30
+		$this->setDescription(__('A country', 'event_espresso'));
31
+		$this->setIsCustomPostType(false);
32
+		parent::__construct($country_model);
33
+	}
34 34
 
35 35
 
36
-    /**
37
-     * @return GraphQLFieldInterface[]
38
-     */
39
-    public function getFields()
40
-    {
41
-        $fields = [
42
-            new GraphQLField(
43
-                'id',
44
-                ['non_null' => 'ID'],
45
-                null,
46
-                esc_html__('The globally unique ID for the object.', 'event_espresso')
47
-            ),
48
-            new GraphQLOutputField(
49
-                'cacheId',
50
-                ['non_null' => 'String'],
51
-                null,
52
-                esc_html__('The cache ID of the object.', 'event_espresso')
53
-            ),
54
-            new GraphQLField(
55
-                'isActive',
56
-                'Boolean',
57
-                'is_active',
58
-                esc_html__(
59
-                    'Flag that indicates if the country should appear in dropdown select lists',
60
-                    'event_espresso'
61
-                )
62
-            ),
63
-            new GraphQLField(
64
-                'ISO',
65
-                'String',
66
-                'ID',
67
-                esc_html__('Country ISO Code', 'event_espresso')
68
-            ),
69
-            new GraphQLField(
70
-                'ISO3',
71
-                'String',
72
-                'ISO3',
73
-                esc_html__('Country ISO3 Code', 'event_espresso')
74
-            ),
75
-            new GraphQLField(
76
-                'name',
77
-                'String',
78
-                'name',
79
-                esc_html__('Country Name', 'event_espresso')
80
-            ),
81
-            new GraphQLField(
82
-                'currencyCode',
83
-                'String',
84
-                'currency_code',
85
-                esc_html__('Country Currency Code', 'event_espresso')
86
-            ),
87
-            new GraphQLField(
88
-                'currencySingular',
89
-                'String',
90
-                'currency_name_single',
91
-                esc_html__('Currency Name Singular', 'event_espresso')
92
-            ),
93
-            new GraphQLField(
94
-                'currencyPlural',
95
-                'String',
96
-                'currency_name_plural',
97
-                esc_html__('Currency Name Plural', 'event_espresso')
98
-            ),
99
-            new GraphQLField(
100
-                'currencySign',
101
-                'String',
102
-                'currency_sign',
103
-                __('Currency Sign', 'event_espresso')
104
-            ),
105
-            new GraphQLField(
106
-                'currencySignBeforeNumber',
107
-                'String',
108
-                'currency_sign_before',
109
-                esc_html__('Currency Sign Before Number', 'event_espresso')
110
-            ),
111
-            new GraphQLField(
112
-                'currencyDecimalPlaces',
113
-                'String',
114
-                'currency_decimal_places',
115
-                esc_html__('Currency Decimal Places', 'event_espresso')
116
-            ),
117
-            new GraphQLField(
118
-                'currencyDecimalMark',
119
-                'String',
120
-                'currency_decimal_mark',
121
-                esc_html__('Currency Decimal Mark', 'event_espresso')
122
-            ),
123
-            new GraphQLField(
124
-                'currencyThousandsSeparator',
125
-                'String',
126
-                'currency_thousands_separator',
127
-                esc_html__('Currency Thousands Separator', 'event_espresso')
128
-            ),
129
-        ];
36
+	/**
37
+	 * @return GraphQLFieldInterface[]
38
+	 */
39
+	public function getFields()
40
+	{
41
+		$fields = [
42
+			new GraphQLField(
43
+				'id',
44
+				['non_null' => 'ID'],
45
+				null,
46
+				esc_html__('The globally unique ID for the object.', 'event_espresso')
47
+			),
48
+			new GraphQLOutputField(
49
+				'cacheId',
50
+				['non_null' => 'String'],
51
+				null,
52
+				esc_html__('The cache ID of the object.', 'event_espresso')
53
+			),
54
+			new GraphQLField(
55
+				'isActive',
56
+				'Boolean',
57
+				'is_active',
58
+				esc_html__(
59
+					'Flag that indicates if the country should appear in dropdown select lists',
60
+					'event_espresso'
61
+				)
62
+			),
63
+			new GraphQLField(
64
+				'ISO',
65
+				'String',
66
+				'ID',
67
+				esc_html__('Country ISO Code', 'event_espresso')
68
+			),
69
+			new GraphQLField(
70
+				'ISO3',
71
+				'String',
72
+				'ISO3',
73
+				esc_html__('Country ISO3 Code', 'event_espresso')
74
+			),
75
+			new GraphQLField(
76
+				'name',
77
+				'String',
78
+				'name',
79
+				esc_html__('Country Name', 'event_espresso')
80
+			),
81
+			new GraphQLField(
82
+				'currencyCode',
83
+				'String',
84
+				'currency_code',
85
+				esc_html__('Country Currency Code', 'event_espresso')
86
+			),
87
+			new GraphQLField(
88
+				'currencySingular',
89
+				'String',
90
+				'currency_name_single',
91
+				esc_html__('Currency Name Singular', 'event_espresso')
92
+			),
93
+			new GraphQLField(
94
+				'currencyPlural',
95
+				'String',
96
+				'currency_name_plural',
97
+				esc_html__('Currency Name Plural', 'event_espresso')
98
+			),
99
+			new GraphQLField(
100
+				'currencySign',
101
+				'String',
102
+				'currency_sign',
103
+				__('Currency Sign', 'event_espresso')
104
+			),
105
+			new GraphQLField(
106
+				'currencySignBeforeNumber',
107
+				'String',
108
+				'currency_sign_before',
109
+				esc_html__('Currency Sign Before Number', 'event_espresso')
110
+			),
111
+			new GraphQLField(
112
+				'currencyDecimalPlaces',
113
+				'String',
114
+				'currency_decimal_places',
115
+				esc_html__('Currency Decimal Places', 'event_espresso')
116
+			),
117
+			new GraphQLField(
118
+				'currencyDecimalMark',
119
+				'String',
120
+				'currency_decimal_mark',
121
+				esc_html__('Currency Decimal Mark', 'event_espresso')
122
+			),
123
+			new GraphQLField(
124
+				'currencyThousandsSeparator',
125
+				'String',
126
+				'currency_thousands_separator',
127
+				esc_html__('Currency Thousands Separator', 'event_espresso')
128
+			),
129
+		];
130 130
 
131
-        return apply_filters(
132
-            'FHEE__EventEspresso_core_domain_services_graphql_types__country_fields',
133
-            $fields,
134
-            $this->name,
135
-            $this->model
136
-        );
137
-    }
131
+		return apply_filters(
132
+			'FHEE__EventEspresso_core_domain_services_graphql_types__country_fields',
133
+			$fields,
134
+			$this->name,
135
+			$this->model
136
+		);
137
+	}
138 138
 }
Please login to merge, or discard this patch.