Automattic\WooCommerce\Vendor\GraphQL\Type
SchemaValidationContext::getAllDirectiveArgNodes
Method of the class: SchemaValidationContext{}
No Hooks.
Returns
Array
Usage
// private - for code of main (parent) class only $result = $this->getAllDirectiveArgNodes( $directive, $argName ): array;
- $directive(Directive) (required)
- .
- $argName(string) (required)
- .
SchemaValidationContext::getAllDirectiveArgNodes() SchemaValidationContext::getAllDirectiveArgNodes code WC 10.9.1
private function getAllDirectiveArgNodes(Directive $directive, string $argName): array
{
$astNode = $directive->astNode;
if ($astNode === null) {
return [];
}
$matchingSubnodes = [];
foreach ($astNode->arguments as $subNode) {
if ($subNode->name->value === $argName) {
$matchingSubnodes[] = $subNode;
}
}
return $matchingSubnodes;
}