Ejemplo n.º 1
0
 /**
  * @param BaseJob     $job      The job/source creating the result
  * @param mixed       $result   The result to store
  * @param string|null $resultId An optional id with which to reference this result. If none given, the $job's ID is used.
  *
  * @return mixed|boolean
  */
 protected function publishResult(BaseJob $job, $result, $resultId = null)
 {
     $_resultId = $resultId ?: $job->getJobId();
     if (!$job instanceof PublishesResults) {
         return false;
     }
     return $job->publishResult($_resultId, $result);
 }
Ejemplo n.º 2
0
 /**
  * Create a new command instance.
  *
  * @param int         $ownerId   The id of the entity
  * @param int         $ownerType The type of owner (implied from entity type if null)
  * @param string|null $tag       Optional string to describe your job
  */
 public function __construct($ownerId, $ownerType, $tag = null)
 {
     parent::__construct($tag);
     //  Make sure we have a good types
     $this->ownerInfo = OwnerTypes::getOwner($ownerId, $ownerType);
     $this->ownerId = $ownerId;
     $this->ownerType = is_numeric($ownerType) && OwnerTypes::contains($ownerType) ? $ownerType : OwnerTypes::defines($ownerType, true);
 }
Ejemplo n.º 3
0
 /**
  * @param string|int|null $clusterId
  * @param string|int|null $serverId
  * @param string|null     $tag Optional string to have added to the job id
  */
 public function __construct($clusterId = null, $serverId = null, $tag = null)
 {
     parent::__construct($tag);
     $this->setClusterId($clusterId ?: config('provisioning.default-cluster-id'));
     $this->setServerId($serverId ?: config('provisioning.default-db-server-id'));
 }