Google\Cloud\Storage\Acl::__construct PHP Méthode

__construct() public méthode

public __construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $type, array $identity )
$connection Google\Cloud\Storage\Connection\ConnectionInterface Represents a connection to Cloud Storage.
$type string The type of access control this instance applies to.
$identity array Represents which bucket, file, or generation this instance applies to.
    public function __construct(ConnectionInterface $connection, $type, array $identity)
    {
        $validTypes = ['bucketAccessControls', 'defaultObjectAccessControls', 'objectAccessControls'];
        if (!in_array($type, $validTypes)) {
            throw new InvalidArgumentException('type must be one of the following: ' . implode(', ', $validTypes));
        }
        $this->connection = $connection;
        $this->aclOptions = $identity + ['type' => $type];
    }