Oihana PHP Arango

isSchemaType.php

Table of Contents

Functions

isSchemaType()  : array<string|int, mixed>
Filter documents by the canonical schema type of a Thing class.

Functions

isSchemaType()

Filter documents by the canonical schema type of a Thing class.

isSchemaType(Thing>|array<string|int, Thing>$class[, string $docRef = AQL::DOC ]) : array<string|int, mixed>

Resolves the absolute type URI of the given class — its CONTEXT plus its short name, see Thing::getSchemaType() — and delegates to isAdditionalType(). Accepts several classes for an IN condition.

Parameters
$class : Thing>|array<string|int, Thing>>

The Thing class(es) to filter by.

$docRef : string = AQL::DOC

The AQL doc reference (default: doc).

Tags
throws
InvalidArgumentException

If a class is not Thing or a Thing subclass.

UnsupportedOperationException

If the resolved value type is unsupported.

example
use xyz\oihana\schema\organizations\Customer;
use xyz\oihana\schema\places\CustomerSite;
use xyz\oihana\schema\places\Warehouse;

isSchemaType( Customer::class ) ;
// → doc.additionalType == 'https://schema.oihana.xyz/Customer'

isSchemaType([ CustomerSite::class , Warehouse::class ]) ;
// → doc.additionalType IN [ '…/CustomerSite' , '…/Warehouse' ]
Return values
array<string|int, mixed>

An array containing a single AQL condition expression.

On this page

Search results