graph-tools-php
71 строка · 2.0 Кб
1<?php
2
3namespace Smoren\GraphTools\Conditions\Interfaces;
4
5use Smoren\GraphTools\Models\Interfaces\VertexInterface;
6
7/**
8* Interface for vertex condition
9* @author Smoren <ofigate@gmail.com>
10*/
11interface VertexConditionInterface
12{
13/**
14* Returns whitelist of vertex types or null if whitelist is not defined
15* @return array<string>|null
16*/
17public function getVertexTypesOnly(): ?array;
18
19/**
20* Returns blacklist of vertex types
21* @return array<string>
22*/
23public function getVertexTypesExcluded(): array;
24
25/**
26* Returns whitelist of vertex ids or null if whitelist is not defined
27* @return array<string>|null
28*/
29public function getVertexIdsOnly(): ?array;
30
31/**
32* Returns blacklist of vertex ids
33* @return array<string>
34*/
35public function getVertexIdsExcluded(): array;
36
37/**
38* Sets whitelist of vertex types
39* @param array<string>|null $types whitelist (null if whitelist is not defined)
40* @return VertexConditionInterface
41*/
42public function onlyVertexTypes(?array $types): VertexConditionInterface;
43
44/**
45* Sets blacklist of vertex types
46* @param array<string> $types blacklist
47* @return VertexConditionInterface
48*/
49public function excludeVertexTypes(array $types): VertexConditionInterface;
50
51/**
52* Sets whitelist of vertex ids
53* @param array<string>|null $ids whitelist (null if whitelist is not defined)
54* @return VertexConditionInterface
55*/
56public function onlyVertexIds(?array $ids): VertexConditionInterface;
57
58/**
59* Sets blacklist of vertex ids
60* @param array<string> $ids blacklist
61* @return VertexConditionInterface
62*/
63public function excludeVertexIds(array $ids): VertexConditionInterface;
64
65/**
66* Returns true if vertex satisfies the condition
67* @param VertexInterface $vertex vertex to check
68* @return bool
69*/
70public function isSuitableVertex(VertexInterface $vertex): bool;
71}
72