src/DataDefinition/ModelRelationship/ParentChildCondition.php
private function extractNeededProperties($rule)
    {
        if (\in_array($rule['operation'], ['AND', 'OR'])) {
            $properties = [];
            foreach ($rule['children'] as $childRule) {
                $properties[] = $this->extractNeededProperties($childRule);
            }
            return $properties;
        }

        // Local is child property name.
        if (isset($rule['local'])) {
            return $rule['local'];
        }

        // Remote is parent property name.
        if (isset($rule['property'])) {
            return $rule['property'];
        }

        throw new \RuntimeException('Unexpected filter rule ' . \var_export($rule, true));
    }
private function extractNeededProperties($rule)
    {
        if (\in_array($rule['operation'], ['AND', 'OR'])) {
            $properties = [];
            foreach ($rule['children'] as $childRule) {
                $properties[] = $this->extractNeededProperties($childRule);
            }
            return $properties;
        }

        // Local is child property name.
        if (isset($rule['local'])) {
            return $rule['local'];
        }

        // Remote is parent property name.
        if (isset($rule['property'])) {
            return $rule['property'];
        }

        throw new \RuntimeException('Unexpected filter rule ' . \var_export($rule, true));
    }
private function extractNeededProperties ( $ rule ) { if ( \ in_array ( $ rule [ 'operation' ] , [ 'AND' , 'OR' ] ) ) { $ properties = [ ] ; foreach ( $ rule [ 'children' ] as $ childRule ) { $ properties [ ] = $ this -> extractNeededProperties ( $ childRule ) ; } return $ properties ; } // Local is child property name. if ( isset ( $ rule [ 'local' ] ) ) { return $ rule [ 'local' ] ; } // Remote is parent property name. if ( isset ( $ rule [ 'property' ] ) ) { return $ rule [ 'property' ] ; } throw new \ RuntimeException ( 'Unexpected filter rule ' . \ var_export ( $ rule , true ) ) ; }
Return the names of the needed properties for filtering.

@param array $rule The filter rule from which the properties shall be extracted from.

@return array

@throws \RuntimeException When an unexpected filter rule is encountered.
Return the names of the needed properties for filtering .