/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); // Initialize text sentence preprocessor component $id = 'textsentencepreprocessor'; $label = 'This component is used for transforming text files'; $txtPreprocessor = new SoftwareComponent($id, $label); $txtPreprocessor['domains'] = []; $txtPreprocessor['configurations'] = []; $txtPreprocessor->save(); // Initialize media search component $id = 'mediasearchcomponent'; $label = 'This component is used for searching media in MongoDB'; $txtPreprocessor = new SoftwareComponent($id, $label); $txtPreprocessor['keys'] = []; $txtPreprocessor->save(); }
/** * Creates a new software component, if it does not already exist in the SoftwareComponents * Collection. * * @param $name Name of the software component to be created * @param $label Label providing once sentence description of the component * @param $creator a function which configures any component specific settings. */ private function createIfNotExist($name, $label, $creator) { $sc = SoftwareComponent::find($name); if (is_null($sc)) { $this->command->info('...Initializing: ' . $name); $component = new SoftwareComponent($name, $label); // Create generic component $creator($component); // Customize anything specific for this component $component->save(); // And save the component } }