class State in Fastly 8.3
Tracks validity of credentials associated with Fastly Api.
Hierarchy
- class \Drupal\fastly\State
 
Expanded class hierarchy of State
3 files declare their use of State
- CredentialCheck.php in modules/
fastlypurger/ src/ Plugin/ Purge/ DiagnosticCheck/ CredentialCheck.php  - FastlySettingsForm.php in src/
Form/ FastlySettingsForm.php  - PurgeOptionsForm.php in src/
Form/ PurgeOptionsForm.php  
1 string reference to 'State'
1 service uses State
File
- src/
State.php, line 10  
Namespace
Drupal\fastlyView source
class State {
  const VALID_PURGE_CREDENTIALS = 'fastly.state.valid_purge_credentials';
  /**
   * The drupal state service.
   *
   * @var \Drupal\Core\State\StateInterface
   */
  protected $state;
  /**
   * ValidateCredentials constructor.
   *
   * @param \Drupal\Core\State\StateInterface $state
   *   The drupal state service.
   */
  public function __construct(StateInterface $state) {
    $this->state = $state;
  }
  /**
   * Get the state of the Fastly credentials related to Purge functionality.
   *
   * Get the Drupal state representing whether or not the configured Fastly Api
   * credentials are sufficient to perform all supported purge operations.
   *
   * @return mixed
   *   The state of the configured Fastly Api credentials
   */
  public function getPurgeCredentialsState() {
    $state = $this->state
      ->get(self::VALID_PURGE_CREDENTIALS);
    return $state;
  }
  /**
   * Set the state of the Fastly credentials related to Purge functionality.
   *
   * Set the Drupal state representing whether or not the configured Fastly Api
   * credentials are sufficient to perform all supported purge operations.
   */
  public function setPurgeCredentialsState($state = FALSE) {
    $this->state
      ->set(self::VALID_PURGE_CREDENTIALS, $state);
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            State:: | 
                  protected | property | The drupal state service. | |
| 
            State:: | 
                  public | function | Get the state of the Fastly credentials related to Purge functionality. | |
| 
            State:: | 
                  public | function | Set the state of the Fastly credentials related to Purge functionality. | |
| 
            State:: | 
                  constant | |||
| 
            State:: | 
                  public | function | ValidateCredentials constructor. |