lib/CosmoW/Riak/GridFS.php
protected function doInsert(array &$a, array $options = array())
    {
        // If there is no file, perform a basic insertion
        if ( ! isset($a['file'])) {
            parent::doInsert($a, $options);
            return;
        }

        /* If the file is dirty (i.e. it must be persisted), delegate to the
         * storeFile() method. Otherwise, perform a basic insertion.
         */
        $file = $a['file']; // instanceof GridFSFile
        unset($a['file']);

        if ($file->isDirty()) {
            $this->storeFile($file, $a, $options);
        } else {
            parent::doInsert($a, $options);
        }

        $a['file'] = $file;
        return $a;
    }
protected function doInsert(array &$a, array $options = array())
    {
        // If there is no file, perform a basic insertion
        if ( ! isset($a['file'])) {
            parent::doInsert($a, $options);
            return;
        }

        /* If the file is dirty (i.e. it must be persisted), delegate to the
         * storeFile() method. Otherwise, perform a basic insertion.
         */
        $file = $a['file']; // instanceof GridFSFile
        unset($a['file']);

        if ($file->isDirty()) {
            $this->storeFile($file, $a, $options);
        } else {
            parent::doInsert($a, $options);
        }

        $a['file'] = $file;
        return $a;
    }
protected function doInsert ( array & $ a , array $ options = array ( ) ) { // If there is no file, perform a basic insertion if ( ! isset ( $ a [ 'file' ] ) ) { parent :: doInsert ( $ a , $ options ) ; return ; } /* If the file is dirty (i.e. it must be persisted), delegate to the
         * storeFile() method. Otherwise, perform a basic insertion.
         */ $ file = $ a [ 'file' ] ; // instanceof GridFSFile unset ( $ a [ 'file' ] ) ; if ( $ file -> isDirty ( ) ) { $ this -> storeFile ( $ file , $ a , $ options ) ; } else { parent :: doInsert ( $ a , $ options ) ; } $ a [ 'file' ] = $ file ; return $ a ; }
Execute the insert query and persist the GridFSFile if necessary.

@see Collection::doInsert()
@param array $a
@param array $options
@return mixed
Execute the insert query and persist the GridFSFile if necessary .