protected function proceedFiles(array $patchset)
    {
        if (array_key_exists('files', $patchset) === false || is_array($patchset['files']) === false) {
            return;
        }

        foreach ($patchset['files'] as $file) {
            // Take care of file action
            $type = $this->proceedLookupTable(Database::TABLE_FILEACTION, 'id', 'name', $file['type']);

            $fileData = array(
                'patchset' => $patchset['id'],
                'file' => $file['file'],
                'file_old' => ((array_key_exists('fileOld', $file) === true) ? $file['fileOld'] : ''),
                'insertions' => $file['insertions'],
                'deletions' => $file['deletions'],
                'type' => $type
            );
            $this->getDatabase()->insertRecord(Database::TABLE_FILES, $fileData);

            $file = $this->unsetKeys($file, array('file', 'fileOld', 'type', 'insertions', 'deletions'));
            $this->checkIfAllValuesWereProceeded($file, 'File');
        }
    }
protected function proceedFiles(array $patchset)
    {
        if (array_key_exists('files', $patchset) === false || is_array($patchset['files']) === false) {
            return;
        }

        foreach ($patchset['files'] as $file) {
            // Take care of file action
            $type = $this->proceedLookupTable(Database::TABLE_FILEACTION, 'id', 'name', $file['type']);

            $fileData = array(
                'patchset' => $patchset['id'],
                'file' => $file['file'],
                'file_old' => ((array_key_exists('fileOld', $file) === true) ? $file['fileOld'] : ''),
                'insertions' => $file['insertions'],
                'deletions' => $file['deletions'],
                'type' => $type
            );
            $this->getDatabase()->insertRecord(Database::TABLE_FILES, $fileData);

            $file = $this->unsetKeys($file, array('file', 'fileOld', 'type', 'insertions', 'deletions'));
            $this->checkIfAllValuesWereProceeded($file, 'File');
        }
    }
protected function proceedFiles ( array $ patchset ) { if ( array_key_exists ( 'files' , $ patchset ) === false || is_array ( $ patchset [ 'files' ] ) === false ) { return ; } foreach ( $ patchset [ 'files' ] as $ file ) { // Take care of file action $ type = $ this -> proceedLookupTable ( Database :: TABLE_FILEACTION , 'id' , 'name' , $ file [ 'type' ] ) ; $ fileData = array ( 'patchset' => $ patchset [ 'id' ] , 'file' => $ file [ 'file' ] , 'file_old' => ( ( array_key_exists ( 'fileOld' , $ file ) === true ) ? $ file [ 'fileOld' ] : '' ) , 'insertions' => $ file [ 'insertions' ] , 'deletions' => $ file [ 'deletions' ] , 'type' => $ type ) ; $ this -> getDatabase ( ) -> insertRecord ( Database :: TABLE_FILES , $ fileData ) ; $ file = $ this -> unsetKeys ( $ file , array ( 'file' , 'fileOld' , 'type' , 'insertions' , 'deletions' ) ) ; $ this -> checkIfAllValuesWereProceeded ( $ file , 'File' ) ; } }
Imports files per patchset

@param array $patchset The current patchset
@return void
Imports files per patchset