public function convertQueryCondition($value)
    {
        // First fetch the type
        if (null === $value) {
            return 0;
        }

        if (!is_array($value)) {
            $value = [$value];
        }

        $hasOperator = false;

        // FIXME Sorry for this
        if (!Misc::isIndexed($value)) {
            // We have an operator.
            $operator = array_keys($value)[0];
            $values = $value[$operator][0];
            $hasOperator = true;
        } else {
            $values = $value;
        }

        foreach ($values as $key => $type) {
            if (null === $type) {
                $values[$key] = 0;
            } else if ($typeId = $this->getTypeId($type, false)) {
                $values[$key] = $typeId;
            } else {
                unset($values[$key]);
            }
        }

        if (empty($values)) {
            // It should not have been empty, this is an impossible
            // condition
            $values = [-1];
        }

        if ($hasOperator) {
            return [$operator => $values];
        } else {
            return $values;
        }
    }
public function convertQueryCondition($value)
    {
        // First fetch the type
        if (null === $value) {
            return 0;
        }

        if (!is_array($value)) {
            $value = [$value];
        }

        $hasOperator = false;

        // FIXME Sorry for this
        if (!Misc::isIndexed($value)) {
            // We have an operator.
            $operator = array_keys($value)[0];
            $values = $value[$operator][0];
            $hasOperator = true;
        } else {
            $values = $value;
        }

        foreach ($values as $key => $type) {
            if (null === $type) {
                $values[$key] = 0;
            } else if ($typeId = $this->getTypeId($type, false)) {
                $values[$key] = $typeId;
            } else {
                unset($values[$key]);
            }
        }

        if (empty($values)) {
            // It should not have been empty, this is an impossible
            // condition
            $values = [-1];
        }

        if ($hasOperator) {
            return [$operator => $values];
        } else {
            return $values;
        }
    }
public function convertQueryCondition ( $ value ) { // First fetch the type if ( null === $ value ) { return 0 ; } if ( ! is_array ( $ value ) ) { $ value = [ $ value ] ; } $ hasOperator = false ; // FIXME Sorry for this if ( ! Misc :: isIndexed ( $ value ) ) { // We have an operator. $ operator = array_keys ( $ value ) [ 0 ] ; $ values = $ value [ $ operator ] [ 0 ] ; $ hasOperator = true ; } else { $ values = $ value ; } foreach ( $ values as $ key => $ type ) { if ( null === $ type ) { $ values [ $ key ] = 0 ; } else if ( $ typeId = $ this -> getTypeId ( $ type , false ) ) { $ values [ $ key ] = $ typeId ; } else { unset ( $ values [ $ key ] ) ; } } if ( empty ( $ values ) ) { // It should not have been empty, this is an impossible // condition $ values = [ - 1 ] ; } if ( $ hasOperator ) { return [ $ operator => $ values ] ; } else { return $ values ; } }
Convert given query condition value which is supposed to contain types
identifiers to integer identifiers

This function will take care of awaited query format
Convert given query condition value which is supposed to contain types identifiers to integer identifiers