commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
GraphQl
GraphQLErrorBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\GraphQl
;
10
11
use
Commercetools\Api\Models\Error\GraphQLErrorObject
;
12
use
Commercetools\Api\Models\Error\GraphQLErrorObjectBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
GraphQLErrorBuilder
implements
Builder
24
{
29
private
$message;
30
35
private
$locations;
36
41
private
$path;
42
47
private
$extensions;
48
53
public
function
getMessage
()
54
{
55
return
$this->message;
56
}
57
62
public
function
getLocations
()
63
{
64
return
$this->locations;
65
}
66
71
public
function
getPath
()
72
{
73
return
$this->path;
74
}
75
82
public
function
getExtensions
()
83
{
84
return
$this->extensions instanceof
GraphQLErrorObjectBuilder
? $this->extensions->
build
() : $this->extensions;
85
}
86
91
public
function
withMessage
(?
string
$message)
92
{
93
$this->message = $message;
94
95
return
$this;
96
}
97
102
public
function
withLocations
(?
GraphQLErrorLocationCollection
$locations)
103
{
104
$this->locations = $locations;
105
106
return
$this;
107
}
108
113
public
function
withPath
(?array $path)
114
{
115
$this->path = $path;
116
117
return
$this;
118
}
119
124
public
function
withExtensions
(?
GraphQLErrorObject
$extensions)
125
{
126
$this->extensions = $extensions;
127
128
return
$this;
129
}
130
135
public
function
withExtensionsBuilder
(?
GraphQLErrorObjectBuilder
$extensions)
136
{
137
$this->extensions = $extensions;
138
139
return
$this;
140
}
141
142
public
function
build
():
GraphQLError
143
{
144
return
new
GraphQLErrorModel
(
145
$this->message,
146
$this->locations,
147
$this->path,
148
$this->extensions instanceof
GraphQLErrorObjectBuilder
? $this->extensions->
build
() : $this->extensions
149
);
150
}
151
152
public
static
function
of
():
GraphQLErrorBuilder
153
{
154
return
new
self
();
155
}
156
}
Commercetools\Api\Models\Error\GraphQLErrorObjectBuilder
Definition:
GraphQLErrorObjectBuilder.php:22
Commercetools\Api\Models\Error\GraphQLErrorObjectBuilder\build
build()
Definition:
GraphQLErrorObjectBuilder.php:23
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder
Definition:
GraphQLErrorBuilder.php:24
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\of
static of()
Definition:
GraphQLErrorBuilder.php:152
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\build
build()
Definition:
GraphQLErrorBuilder.php:142
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\withMessage
withMessage(?string $message)
Definition:
GraphQLErrorBuilder.php:91
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\getPath
getPath()
Definition:
GraphQLErrorBuilder.php:71
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\getExtensions
getExtensions()
Definition:
GraphQLErrorBuilder.php:82
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\withPath
withPath(?array $path)
Definition:
GraphQLErrorBuilder.php:113
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\withExtensions
withExtensions(?GraphQLErrorObject $extensions)
Definition:
GraphQLErrorBuilder.php:124
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\withExtensionsBuilder
withExtensionsBuilder(?GraphQLErrorObjectBuilder $extensions)
Definition:
GraphQLErrorBuilder.php:135
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\withLocations
withLocations(?GraphQLErrorLocationCollection $locations)
Definition:
GraphQLErrorBuilder.php:102
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\getMessage
getMessage()
Definition:
GraphQLErrorBuilder.php:53
Commercetools\Api\Models\GraphQl\GraphQLErrorBuilder\getLocations
getLocations()
Definition:
GraphQLErrorBuilder.php:62
Commercetools\Api\Models\GraphQl\GraphQLErrorLocationCollection
Definition:
GraphQLErrorLocationCollection.php:22
Commercetools\Api\Models\GraphQl\GraphQLErrorModel
Definition:
GraphQLErrorModel.php:23
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Error\GraphQLErrorObject
Definition:
GraphQLErrorObject.php:15
Commercetools\Api\Models\GraphQl\GraphQLError
Definition:
GraphQLError.php:16
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\GraphQl
Definition:
GraphQLError.php:9
Generated by
1.9.1