You are here

public function LockrAdmin::createKeyring in Lockr 7.3

Parameters

string $label:

bool $has_cc:

DateTime $trial_end:

Return value

string

File

vendor/lockr/lockr/src/LockrAdmin.php, line 29

Class

LockrAdmin

Namespace

Lockr

Code

public function createKeyring($label, $has_cc, DateTime $trial_end) {
  $query = <<<'EOQ'
mutation CreateKeyring($input: CreateKeyring!) {
    createKeyring(input: $input) {
        id
    }
}
EOQ;
  $data = $this->client
    ->query([
    'query' => $query,
    'variables' => [
      'input' => [
        'label' => $label,
        'hasCreditCard' => $has_cc,
        'trialEnd' => $trial_end
          ->format(DateTime::RFC3339),
      ],
    ],
  ]);
  return $data['createKeyring']['id'];
}