src/Data/DefaultDataProvider.php
private function insertModelIntoDatabase(ModelInterface $model, $timestamp = 0)
    {
        $data = $this->convertModelToDataPropertyArray($model, $timestamp);
        if ($this->getIdGenerator()) {
            $model->setId($this->getIdGenerator()->generate());
            $data[$this->idProperty] = $model->getId();
        }

        $this->connection->insert($this->source, $data);

        $insertId = $this->connection->lastInsertId($this->source);

        if (('' !== $insertId) && !isset($data[$this->idProperty])) {
            $model->setId($insertId);
        }
    }
private function insertModelIntoDatabase(ModelInterface $model, $timestamp = 0)
    {
        $data = $this->convertModelToDataPropertyArray($model, $timestamp);
        if ($this->getIdGenerator()) {
            $model->setId($this->getIdGenerator()->generate());
            $data[$this->idProperty] = $model->getId();
        }

        $this->connection->insert($this->source, $data);

        $insertId = $this->connection->lastInsertId($this->source);

        if (('' !== $insertId) && !isset($data[$this->idProperty])) {
            $model->setId($insertId);
        }
    }
private function insertModelIntoDatabase ( ModelInterface $ model , $ timestamp = 0 ) { $ data = $ this -> convertModelToDataPropertyArray ( $ model , $ timestamp ) ; if ( $ this -> getIdGenerator ( ) ) { $ model -> setId ( $ this -> getIdGenerator ( ) -> generate ( ) ) ; $ data [ $ this -> idProperty ] = $ model -> getId ( ) ; } $ this -> connection -> insert ( $ this -> source , $ data ) ; $ insertId = $ this -> connection -> lastInsertId ( $ this -> source ) ; if ( ( '' !== $ insertId ) && ! isset ( $ data [ $ this -> idProperty ] ) ) { $ model -> setId ( $ insertId ) ; } }
Insert the model into the database.

@param ModelInterface $model     The model to insert into the database.
@param int            $timestamp Optional the timestamp.

@return void
Insert the model into the database .