Cronario\AbstractJob::getData PHP Method

getData() public method

public getData ( null $key = null, null $default = null ) : string | integer | null
$key null
$default null
return string | integer | null
    public function getData($key = null, $default = null)
    {
        if (null === $key) {
            return $this->data;
        }
        return $this->hasData($key) ? $this->data[$key] : $default;
    }

Usage Example

Example #1
0
 /**
  * @param AbstractJob $job
  *
  * @return bool
  * @throws \Cronario\Exception\JobException
  */
 public function save(AbstractJob $job)
 {
     $data = $job->getData();
     if (!$job->isStored()) {
         $job->setId(uniqid());
     }
     $this->redis->set($this->namespace . $job->getId(), json_encode($data));
     return true;
 }
All Usage Examples Of Cronario\AbstractJob::getData