1 | <?php |
||
19 | class NotificationGroupsLocator { |
||
20 | |||
21 | /** |
||
22 | * @var Store |
||
23 | */ |
||
24 | private $store; |
||
25 | |||
26 | /** |
||
27 | * @since 1.0 |
||
28 | * |
||
29 | * @param Store $store |
||
30 | */ |
||
31 | 5 | public function __construct( Store $store ) { |
|
34 | |||
35 | /** |
||
36 | * Special group |
||
37 | * |
||
38 | * @since 1.0 |
||
39 | * |
||
40 | * @return [] |
||
|
|||
41 | */ |
||
42 | 1 | public function getSpecialGroupOnSpecificationChange() { |
|
43 | return array( |
||
44 | 1 | NotificationGroupValue::SPECIAL_GROUP => array( new DIBlob( NotificationGroupValue::getSpecialGroupName() ) ) |
|
45 | ); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @since 1.0 |
||
50 | * |
||
51 | * @param DataItem $dataItem |
||
52 | * @param array $subSemanticDataMatch |
||
53 | * |
||
54 | * @return DataItem[] |
||
55 | */ |
||
56 | 2 | public function findNotificationsToGroupList( DataItem $dataItem, array $subSemanticDataMatch ) { |
|
57 | |||
58 | 2 | $property = new DIProperty( |
|
59 | 2 | PropertyRegistry::NOTIFICATIONS_TO_GROUP |
|
60 | ); |
||
61 | |||
62 | // Either match the property on a plain assignment or |
||
63 | 2 | if ( ( $pv = $this->store->getPropertyValues( $dataItem, $property ) ) !== array() ) { |
|
64 | return $pv; |
||
65 | } |
||
66 | |||
67 | // Find out whether a detection matrix was build using a subobject |
||
68 | 2 | $semanticData = $this->store->getSemanticData( |
|
69 | 2 | $dataItem |
|
70 | ); |
||
71 | |||
72 | 2 | $propertyValues = array(); |
|
73 | |||
74 | // Get the group from the subobject that contained the matchable |
||
75 | // condition from the preceding filterOnChange process |
||
76 | 2 | foreach ( $subSemanticDataMatch as $hash => $value ) { |
|
77 | 1 | foreach ( $value as $sobj ) { |
|
78 | if ( |
||
79 | 1 | ( $hash === $dataItem->getHash() ) && |
|
80 | 1 | ( $subSemanticData = $semanticData->findSubSemanticData( $sobj ) ) !== array() ) { |
|
81 | 1 | $propertyValues = array_merge( $propertyValues, $subSemanticData->getPropertyValues( $property ) ); |
|
82 | } |
||
83 | } |
||
84 | } |
||
85 | |||
86 | 2 | return $propertyValues; |
|
87 | } |
||
88 | |||
89 | /** |
||
90 | * @since 1.0 |
||
91 | * |
||
92 | * @param array $subSemanticDataMatch |
||
93 | * |
||
94 | * @return Closure |
||
95 | */ |
||
96 | public function getNotificationsToGroupListAsCallback( array $subSemanticDataMatch ) { |
||
101 | |||
102 | } |
||
103 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.