class CliService in Apigee Edge 8
A CLI service which defines all the commands logic and delegates the methods.
Hierarchy
- class \Drupal\apigee_edge\CliService implements CliServiceInterface
Expanded class hierarchy of CliService
1 string reference to 'CliService'
1 service uses CliService
File
- src/
CliService.php, line 29
Namespace
Drupal\apigee_edgeView source
class CliService implements CliServiceInterface {
/**
* The service that makes calls to the Apigee API.
*
* @var \Drupal\apigee_edge\Command\Util\ApigeeEdgeManagementCliServiceInterface
*/
private $apigeeEdgeManagementCliService;
/**
* CliService constructor.
*
* @param \Drupal\apigee_edge\Command\Util\ApigeeEdgeManagementCliServiceInterface $apigeeEdgeManagementCliService
* The ApigeeEdgeManagementCliService to make calls to Apigee Edge.
*/
public function __construct(ApigeeEdgeManagementCliServiceInterface $apigeeEdgeManagementCliService) {
$this->apigeeEdgeManagementCliService = $apigeeEdgeManagementCliService;
}
/**
* {@inheritdoc}
*/
public function sync(StyleInterface $io, callable $t) {
$io
->title($t('Developer - User synchronization'));
$batch = DeveloperSyncController::getBatch();
$last_message = '';
foreach ($batch['operations'] as $operation) {
$context = [
'finished' => 0,
];
while ($context['finished'] < 1) {
call_user_func_array($operation[0], array_merge($operation[1], [
&$context,
]));
if (isset($context['message']) && $context['message'] !== $last_message) {
$io
->text($t($context['message']));
}
$last_message = $context['message'];
gc_collect_cycles();
}
}
}
/**
* {@inheritdoc}
*/
public function createEdgeRoleForDrupal(StyleInterface $io, callable $t, string $org, string $email, string $password, ?string $base_url, ?string $role_name, ?bool $force) {
$this->apigeeEdgeManagementCliService
->createEdgeRoleForDrupal($io, $t, $org, $email, $password, $base_url, $role_name, $force);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CliService:: |
private | property | The service that makes calls to the Apigee API. | |
CliService:: |
public | function |
Create an Apigee role for Drupal use. Overrides CliServiceInterface:: |
|
CliService:: |
public | function |
Handle the sync interaction. Overrides CliServiceInterface:: |
|
CliService:: |
public | function | CliService constructor. |