function toDatabase() { $ql = new cSistema_lenguaje(); $totrad = array(); $palabras = $this->getWords(); foreach ($palabras as $eq => $tra) { $id = $ql->query()->getLastID(); $ql->idsistema_lenguaje($id); $ql->equivalente($eq); $ql->traduccion($tra); $ql->extension(''); $ql->query()->insert()->save(); $totrad[$id] = $tra; } return json_encode($totrad); }