public function getInstance()
    {
        if (!is_null($this->instance)) {
            return $this->instance;
        }

        if (!class_exists($this->class)) {
            throw new \RuntimeException('Could not find job class "'.$this->class.'"');
        }

        if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {
            throw new \RuntimeException('Job class "'.$this->class.'" does not contain a public "'.$this->method.'" method');
        }

        $class = new \ReflectionClass($this->class);

        if ($class->isAbstract()) {
            throw new \RuntimeException('Job class "'.$this->class.'" cannot be an abstract class');
        }

        $instance = $class->newInstance();

        return $this->instance = $instance;
    }
public function getInstance()
    {
        if (!is_null($this->instance)) {
            return $this->instance;
        }

        if (!class_exists($this->class)) {
            throw new \RuntimeException('Could not find job class "'.$this->class.'"');
        }

        if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {
            throw new \RuntimeException('Job class "'.$this->class.'" does not contain a public "'.$this->method.'" method');
        }

        $class = new \ReflectionClass($this->class);

        if ($class->isAbstract()) {
            throw new \RuntimeException('Job class "'.$this->class.'" cannot be an abstract class');
        }

        $instance = $class->newInstance();

        return $this->instance = $instance;
    }
public function getInstance ( ) { if ( ! is_null ( $ this -> instance ) ) { return $ this -> instance ; } if ( ! class_exists ( $ this -> class ) ) { throw new \ RuntimeException ( 'Could not find job class "' . $ this -> class . '"' ) ; } if ( ! method_exists ( $ this -> class , $ this -> method ) or ! is_callable ( array ( $ this -> class , $ this -> method ) ) ) { throw new \ RuntimeException ( 'Job class "' . $ this -> class . '" does not contain a public "' . $ this -> method . '" method' ) ; } $ class = new \ ReflectionClass ( $ this -> class ) ; if ( $ class -> isAbstract ( ) ) { throw new \ RuntimeException ( 'Job class "' . $ this -> class . '" cannot be an abstract class' ) ; } $ instance = $ class -> newInstance ( ) ; return $ this -> instance = $ instance ; }
Get the instantiated object for this job that will be performing work

@return object Instance of the object that this job belongs to
Get the instantiated object for this job that will be performing work