Skip to content

Instantly share code, notes, and snippets.

@sunilw
Created November 25, 2014 11:10
Show Gist options
  • Save sunilw/91e814ab587b5353541f to your computer and use it in GitHub Desktop.
Save sunilw/91e814ab587b5353541f to your computer and use it in GitHub Desktop.
foreach ( (array) $info['data_sources'] as $var => $data_source ) {
if ( isset( $this->_data_sources[$var] ) ) {
if ( is_callable( array( $this->_data_sources[$var], 'run_import' ) ) ) {
if ( ! isset( $settings['data_sources'][$var] ) )
$settings['data_sources'][$var] = array();
else if ( isset( $settings['data_sources'][$var]['method'] ) && ( 'skip' == $settings['data_sources'][$var]['method'] ) )
continue;
$db_settings = ( isset( $db_data[$var] ) ) ? $db_data[$var] : false;
$result = $this->_data_sources[$var]->run_import( $info['data_sources'][$var], $this->get_data( $var ), $settings['data_sources'][$var], $new_attachments, $return_data, $db_settings );
if ( $return_data )
$results[$var] = $result;
if ( false === $result )
$errors[] = "$var:failed_run_import";
}
else
$errors[] = "$var:missing_run_import";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment