/** * Path of the JSON file to be parsed * @param String $filepath file path */ public function setDatasource($filepath) { if (!file_exists($filepath)) { throw new FileNotFoundException('Recipe JSON file not found in ' . $filepath); } parent::setDatasource($filepath); $json_content = file_get_contents($filepath); $this->json_recipes = json_decode($json_content, TRUE); return $this; }
/** * Path of the CSV file to be parsed * @param String $filepath file path */ public function setDatasource($filepath) { parent::setDatasource($filepath); $this->initParser(); return $this; }