Skip to content

Commit

Permalink
📦 Add set_queue method to directly set queue data
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-James committed Aug 2, 2021
1 parent cdd700a commit d602af7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ public function push_to_queue( $data ) {
return $this;
}

/**
* Set the data for queue.
*
* Use this only if you have the data in correct format.
* CAUTION: You should call Task::save() right after this
* because this will replace the data in current queue.
*
* @param mixed $data Data to process.
*
* @since 1.0.2
* @access public
*
* @return Task $this
*/
public function set_queue( $data ) {
$this->data = $data;

return $this;
}

/**
* Save the process queue.
*
Expand Down

0 comments on commit d602af7

Please sign in to comment.