private function doInsertByQueries(): void
    {
        $data = $this->generateFakeData();

        $queryBuilder = $this->dbUtils->getConn()->createQueryBuilder();
        $queryBuilder = $queryBuilder->insert($this->entity);
        foreach ($data as $field => $value) {
            $queryBuilder = $queryBuilder->setValue($field, ":$field");
            $queryBuilder = $queryBuilder->setParameter(":$field", $value);
        }

        $this->returnRes === true ?
            array_push($this->queries, $this->dbUtils->getRawSQL($queryBuilder)) :
            null;

        if ($this->pretend === false) {
            $queryBuilder->execute();
        }
    }
private function doInsertByQueries(): void
    {
        $data = $this->generateFakeData();

        $queryBuilder = $this->dbUtils->getConn()->createQueryBuilder();
        $queryBuilder = $queryBuilder->insert($this->entity);
        foreach ($data as $field => $value) {
            $queryBuilder = $queryBuilder->setValue($field, ":$field");
            $queryBuilder = $queryBuilder->setParameter(":$field", $value);
        }

        $this->returnRes === true ?
            array_push($this->queries, $this->dbUtils->getRawSQL($queryBuilder)) :
            null;

        if ($this->pretend === false) {
            $queryBuilder->execute();
        }
    }
private function doInsertByQueries ( ) : void { $ data = $ this -> generateFakeData ( ) ; $ queryBuilder = $ this -> dbUtils -> getConn ( ) -> createQueryBuilder ( ) ; $ queryBuilder = $ queryBuilder -> insert ( $ this -> entity ) ; foreach ( $ data as $ field => $ value ) { $ queryBuilder = $ queryBuilder -> setValue ( $ field , ":$field" ) ; $ queryBuilder = $ queryBuilder -> setParameter ( ":$field" , $ value ) ; } $ this -> returnRes === true ? array_push ( $ this -> queries , $ this -> dbUtils -> getRawSQL ( $ queryBuilder ) ) : null ; if ( $ this -> pretend === false ) { $ queryBuilder -> execute ( ) ; } }
Execute an INSERT with Doctrine QueryBuilder
@SuppressWarnings("unused") - Used dynamically
Execute an INSERT with Doctrine QueryBuilder