示例#1
0
 function __construct()
 {
     $this->initConnection();
     $tasks = $this->dbquery('SELECT * FROM translation_cronjobs');
     //print_r($tasks);
     foreach ($tasks as $task) {
         $id = $task['revision_id'];
         $language = $task['to_language'];
         $old_deck = new Deck();
         $old_deck->createFromID($id);
         $new_deck = new Deck();
         $new_deck->createFromID($task['future_deck']);
         $new_deck->translation_status = 'translated';
         $new_deck->content = $old_deck->content;
         if ($new_deck->translate_parent($language)) {
             $old_deck->removeFromQueue($id, $language);
         }
     }
 }