private function convertFilterProps(array $filter)
    {
        if (isset($filter['propertyFilter'])) {
            $operator = $filter['propertyFilter']['op'];

            $constName = PropertyFilterOperator::class . '::' . $operator;
            if (!defined($constName)) {
                throw new \InvalidArgumentException('Invalid operator.');
            }

            $filter['propertyFilter']['op'] = constant($constName);
        }

        if (isset($filter['compositeFilter'])) {
            $filter['compositeFilter']['op'] = CompositeFilterOperator::PBAND;

            foreach ($filter['compositeFilter']['filters'] as &$nested) {
                $nested = $this->convertFilterProps($nested);
            }
        }

        return $filter;
    }