You are here

class UserCreate in Apigee Edge 8

A job to create a Drupal user from an Apigee Edge developer.

Hierarchy

Expanded class hierarchy of UserCreate

File

src/Job/UserCreate.php, line 27

Namespace

Drupal\apigee_edge\Job
View source
class UserCreate extends UserCreateUpdate {

  /**
   * {@inheritdoc}
   */
  protected function afterUserSave(DeveloperToUserConversionResult $result) : void {
    $context = [];

    // If user could be saved.
    if ($result
      ->getUser()
      ->id()) {
      $context['link'] = $result
        ->getUser()
        ->toLink(t('View user'))
        ->toString();
    }

    // Only log problems after a user has been saved because this way we can
    // provide an link to its profile page in log entries.
    $this
      ->logConversionProblems($result
      ->getProblems(), $context);
    parent::afterUserSave($result);
  }

  /**
   * {@inheritdoc}
   */
  public function __toString() : string {
    return t('Copying developer (@email) from Apigee Edge.', [
      '@email' => $this->email,
    ])
      ->render();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EdgeJob::$request protected property Request data.
EdgeJob::$response protected property Response data.
EdgeJob::execute public function Executes this job. Overrides Job::execute 1
EdgeJob::getConnector protected function Returns the SDK connector instance from the global container.
EdgeJob::renderArray public function Returns this job's visual representation. Overrides Job::renderArray
Job::$exceptions protected property Exception storage.
Job::$id private property Job ID.
Job::$messages protected property Messages storage.
Job::$retry protected property Remaining retries.
Job::$status protected property Job status.
Job::$tag private property The tag of the job.
Job::ALL_STATUSES protected constant Job statuses.
Job::consumeRetry public function Consumes a retry.
Job::FAILED public constant Job is failed, and it won't be retried.
Job::FINISHED public constant Job is finished successfully.
Job::getExceptions public function Gets all stored exception data.
Job::getId public function Gets the job id.
Job::getMessages public function Gets all stored messages.
Job::getStatus public function Gets the status of the job.
Job::getTag public function Gets the job tag.
Job::IDLE public constant Job is waiting to be picked up by a worker.
Job::recordException public function Adds an exception to the exception storage.
Job::recordMessage public function Adds a message to the message storage.
Job::RESCHEDULED public constant Job failed, waiting to be retried.
Job::RUNNING public constant Job is running.
Job::SELECTED public constant Job is claimed by a worker, but not running yet.
Job::setStatus public function Sets the status of the job.
Job::setTag public function Sets the job tag.
Job::shouldRetry public function Whether this job should be retried when an exception is thrown.
UserCreate::afterUserSave protected function Execute actions after the user has been saved. Overrides UserCreateUpdate::afterUserSave
UserCreate::__toString public function Returns this job's textual representation. Overrides Job::__toString
UserCreateUpdate::$email protected property The Apigee Edge developer's email.
UserCreateUpdate::beforeUserSave protected function Execute actions before the user gets saved. 1
UserCreateUpdate::executeRequest protected function Executes the request itself. Overrides EdgeJob::executeRequest
UserCreateUpdate::logConversionProblem protected function Logs an entity conversation problems encountered meanwhile syncing. Overrides UserDeveloperSyncJobTrait::logConversionProblem
UserCreateUpdate::__construct public function UserCreateUpdate constructor. Overrides Job::__construct
UserDeveloperSyncJobTrait::fieldAttributeConverter protected function Field-attribute converter service.
UserDeveloperSyncJobTrait::logConversionProblems protected function Logs all entity conversion problems encountered meanwhile syncing.
UserDeveloperSyncJobTrait::logger protected function Logger interface.
UserDeveloperSyncJobTrait::userDeveloperConverter protected function User-developer converter service.