Exemple #1
0
 function createJobWithItems($action = 'translate')
 {
     $job = parent::createJob();
     for ($i = 1; $i < 3; $i++) {
         if ($i == 3) {
             // Explicitly define the data for the third item.
             $data['data'] = array('dummy' => array('deep_nesting' => array('#text' => 'Stored data')));
             $job->addItem('test_source', 'test', $i, array($data));
         }
         $job->addItem('test_source', 'test', $i);
     }
     // Manually specify the translator for now.
     $job->translator = $this->default_translator->id();
     $job->settings = array('action' => $action);
     return $job;
 }