$max_depth) { $max_depth = $depth; } } } return $max_depth; } $data = Yaml::parse(file_get_contents(__DIR__ . '/not-recorded-in-db.yaml')); $db = new Database(new DatabaseConfig('opendata')); // $orgs = ContingentManager::getInstance()->getOrgs($dbOpendata); if(array_depth($data) == 2){ ContingentManager::getInstance()->insertContingent($db, $data); } else { foreach ($data as $value) { ContingentManager::getInstance()->insertContingent($db, $value); } }