Example #1
0
 protected function process_data(&$signal)
 {
     $result = parent::process_data($signal);
     if ($result === false) {
         return false;
     }
     $title = $signal->data_title($this->default_data_key);
     if (is_null($title)) {
         $this->log("Could not determine the title from a signal!", LL_ERROR);
         return false;
     }
     if (!empty($this->tasks)) {
         $to_title = $title;
         if (array_key_exists('with', $this->tasks)) {
             $to_title = $this->do_rule($to_title, $this->tasks);
         } else {
             foreach ($this->tasks as $task) {
                 $to_title = $this->do_rule($to_title, $task);
             }
         }
         $result = $title !== $to_title;
         if ($result) {
             $signal->set_param('writer', 'to_title', $to_title);
             $this->add_changes("Moving [[{$title}]] as [[{$to_title}]]");
         }
     } else {
         $this->log("Title [[" . $title . "]] is not to be changed", LL_DEBUG);
     }
     $this->set_jobdata($result);
     return $result;
 }
Example #2
0
 protected function set_params($params)
 {
     $this->_set_param($params, 'autofetch');
     return parent::set_params($params);
 }