lib/Persistence/Doctrine/QueryHandler/LayoutResolverQueryHandler.php
public function addCondition(Condition $condition): Condition
    {
        $query = $this->connection->createQueryBuilder()
            ->insert('ngbm_rule_condition')
            ->values(
                [
                    'id' => ':id',
                    'status' => ':status',
                    'rule_id' => ':rule_id',
                    'type' => ':type',
                    'value' => ':value',
                ]
            )
            ->setValue(
                'id',
                $condition->id !== null ?
                    (int) $condition->id :
                    $this->connectionHelper->getAutoIncrementValue('ngbm_rule_condition')
            )
            ->setParameter('status', $condition->status, Type::INTEGER)
            ->setParameter('rule_id', $condition->ruleId, Type::INTEGER)
            ->setParameter('type', $condition->type, Type::STRING)
            ->setParameter('value', json_encode($condition->value), Type::STRING);

        $query->execute();

        $condition->id = $condition->id ?? (int) $this->connectionHelper->lastInsertId('ngbm_rule_condition');

        return $condition;
    }
public function addCondition(Condition $condition): Condition
    {
        $query = $this->connection->createQueryBuilder()
            ->insert('ngbm_rule_condition')
            ->values(
                [
                    'id' => ':id',
                    'status' => ':status',
                    'rule_id' => ':rule_id',
                    'type' => ':type',
                    'value' => ':value',
                ]
            )
            ->setValue(
                'id',
                $condition->id !== null ?
                    (int) $condition->id :
                    $this->connectionHelper->getAutoIncrementValue('ngbm_rule_condition')
            )
            ->setParameter('status', $condition->status, Type::INTEGER)
            ->setParameter('rule_id', $condition->ruleId, Type::INTEGER)
            ->setParameter('type', $condition->type, Type::STRING)
            ->setParameter('value', json_encode($condition->value), Type::STRING);

        $query->execute();

        $condition->id = $condition->id ?? (int) $this->connectionHelper->lastInsertId('ngbm_rule_condition');

        return $condition;
    }
public function addCondition ( Condition $ condition ) : Condition { $ query = $ this -> connection -> createQueryBuilder ( ) -> insert ( 'ngbm_rule_condition' ) -> values ( [ 'id' => ':id' , 'status' => ':status' , 'rule_id' => ':rule_id' , 'type' => ':type' , 'value' => ':value' , ] ) -> setValue ( 'id' , $ condition -> id !== null ? ( int ) $ condition -> id : $ this -> connectionHelper -> getAutoIncrementValue ( 'ngbm_rule_condition' ) ) -> setParameter ( 'status' , $ condition -> status , Type :: INTEGER ) -> setParameter ( 'rule_id' , $ condition -> ruleId , Type :: INTEGER ) -> setParameter ( 'type' , $ condition -> type , Type :: STRING ) -> setParameter ( 'value' , json_encode ( $ condition -> value ) , Type :: STRING ) ; $ query -> execute ( ) ; $ condition -> id = $ condition -> id ?? ( int ) $ this -> connectionHelper -> lastInsertId ( 'ngbm_rule_condition' ) ; return $ condition ; }
Adds a condition.
Adds a condition .