Google\Cloud\Storage\StorageObject::__construct PHP Method

__construct() public method

public __construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $name, string $bucket, string $generation = null, array $info = null, string $encryptionKey = null, string $encryptionKeySHA256 = null )
$connection Google\Cloud\Storage\Connection\ConnectionInterface Represents a connection to Cloud Storage.
$name string The object's name.
$bucket string The name of the bucket the object is contained in.
$generation string [optional] The generation of the object.
$info array [optional] The object's metadata.
$encryptionKey string [optional] An AES-256 customer-supplied encryption key.
$encryptionKeySHA256 string [optional] The SHA256 hash of the customer-supplied encryption key.
    public function __construct(ConnectionInterface $connection, $name, $bucket, $generation = null, array $info = null, $encryptionKey = null, $encryptionKeySHA256 = null)
    {
        $this->connection = $connection;
        $this->info = $info;
        $this->encryptionData = ['encryptionKey' => $encryptionKey, 'encryptionKeySHA256' => $encryptionKeySHA256];
        $this->identity = ['bucket' => $bucket, 'object' => $name, 'generation' => $generation];
        $this->acl = new Acl($this->connection, 'objectAccessControls', $this->identity);
    }