/** * Seed the prefixes table based on the prefixes json file * * @return void */ private function seedGeoprojections() { // Empty the ontology table \Geoprojection::truncate(); // Fetch the ontology from the json file $geoprojections = json_decode(file_get_contents(app_path() . '/database/seeds/data/geoprojections.json')); if (!empty($geoprojections)) { \Geoprojection::truncate(); foreach ($geoprojections as $language) { \Geoprojection::create(array('epsg' => $language->epsg, 'projection' => $language->projection)); } $this->command->info("Added the geographical projections."); } }
/** * Delete everything out of our testing database. */ public static function tearDownAfterClass() { parent::tearDownAfterClass(); \Definition::truncate(); \CsvDefinition::truncate(); \InstalledDefinition::truncate(); \JsonDefinition::truncate(); \ShpDefinition::truncate(); \SparqlDefinition::truncate(); \XlsDefinition::truncate(); \XmlDefinition::truncate(); \GeoProperty::truncate(); \TabularColumns::truncate(); \Geoprojection::truncate(); }
private function seedGeoProjections() { $this->command->info('---- Geo projections ----'); $this->command->info('Fetching geoprojections from the local json file.'); $geoprojections = json_decode(file_get_contents(app_path() . '/database/seeds/data/geoprojections.json')); if (!empty($geoprojections)) { $this->command->info('Geoprojections have been found, deleting the current ones, and replacing them with the new ones.'); \Geoprojection::truncate(); foreach ($geoprojections as $language) { \Geoprojection::create(array('epsg' => $language->epsg, 'projection' => $language->projection)); } $this->command->info('Added the geoprojections from a local json file.'); } else { $this->command->info('No languages have not been found, the old ones will not be replaced.'); } }