Core/src/Batch/JobConfig.php
public function registerJob($identifier, $callback)
    {
        if (array_key_exists($identifier, $this->identifierToId)) {
            $idNum = $this->identifierToId[$identifier];
        } else {
            $idNum = count($this->identifierToId) + 1;
            $this->idToIdentifier[$idNum] = $identifier;
        }
        $this->jobs[$identifier] = call_user_func(
            $callback,
            $idNum
        );
        $this->identifierToId[$identifier] = $idNum;
    }
public function registerJob($identifier, $callback)
    {
        if (array_key_exists($identifier, $this->identifierToId)) {
            $idNum = $this->identifierToId[$identifier];
        } else {
            $idNum = count($this->identifierToId) + 1;
            $this->idToIdentifier[$idNum] = $identifier;
        }
        $this->jobs[$identifier] = call_user_func(
            $callback,
            $idNum
        );
        $this->identifierToId[$identifier] = $idNum;
    }
public function registerJob ( $ identifier , $ callback ) { if ( array_key_exists ( $ identifier , $ this -> identifierToId ) ) { $ idNum = $ this -> identifierToId [ $ identifier ] ; } else { $ idNum = count ( $ this -> identifierToId ) + 1 ; $ this -> idToIdentifier [ $ idNum ] = $ identifier ; } $ this -> jobs [ $ identifier ] = call_user_func ( $ callback , $ idNum ) ; $ this -> identifierToId [ $ identifier ] = $ idNum ; }
Register a job for executing in batch.

@param string $identifier Unique identifier of the job.
@param callable $callback Callback that accepts the job $idNum
and returns a JobInterface instance.
@return void
Register a job for executing in batch .