NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class Acp

Amazon S3 Access Control Policy (ACP)

  Aws\S3\Model\Acp implements Guzzle\Common\ToArrayInterface, IteratorAggregate, Countable

Namespace: Aws\S3\Model
Located at Aws/S3/Model/Acp.php

## Methods summary

- `public` `__construct ( Aws\S3\Model\Grantee $owner, array|\Traversable $grants = null )`

  Constructs an ACP

- `public static` `fromArray ( array $data )`

  Create an Acp object from an array. This can be used to create an ACP from a response to a GetObject/Bucket ACL operation.

- `public` `setOwner ( Aws\S3\Model\Grantee $owner )`

  Set the owner of the ACP policy

- `public` `getOwner ( )`

  Get the owner of the ACP policy

- `public` `setGrants ( array|\Traversable $grants = array() )`

  Set the grants for the ACP

- `public` `getGrants ( )`

  Get all of the grants

- `public` `addGrant ( Aws\S3\Model\Grant $grant )`

  Add a Grant

- `public` `count ( )`

  Get the total number of attributes

- `public` `getIterator ( )`

  Returns the grants for iteration

- `public` `updateCommand ( Guzzle\Service\Command\AbstractCommand $command )`

  Applies grant headers to a command's parameters

- `public` `toArray ( )`

  Get the array representation of an object

## Methods detail

# `public`
`__construct( `Aws\S3\Model\Grantee` $owner, array|`Traversable` $grants = null )`

Constructs an ACP

#### Parameters

$owner
  ``Aws\S3\Model\Grantee``
  $owner ACP policy owner
$grants
  `array|`Traversable``
  $grants List of grants for the ACP

# `public static `Aws\S3\Model\Acp``
`fromArray( array $data )`

Create an Acp object from an array. This can be used to create an ACP from a response to a GetObject/Bucket ACL operation.

#### Parameters

$data
  `array`
  $data Array of ACP data

#### Returns

``Aws\S3\Model\Acp``
# `public mixed`
`setOwner( `Aws\S3\Model\Grantee` $owner )`

Set the owner of the ACP policy

#### Parameters

$owner
  ``Aws\S3\Model\Grantee``
  $owner ACP policy owner

#### Returns

`mixed`
$this

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
if the grantee does not have an ID set
# `public `Aws\S3\Model\Grantee``
`getOwner( )`

Get the owner of the ACP policy

#### Returns

``Aws\S3\Model\Grantee``
# `public mixed`
`setGrants( array|`Traversable` $grants = array() )`

Set the grants for the ACP

#### Parameters

$grants
  `array|`Traversable``
  $grants List of grants for the ACP

#### Returns

`mixed`
$this

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
# `public `SplObjectStorage``
`getGrants( )`

Get all of the grants

#### Returns

``SplObjectStorage``
# `public mixed`
`addGrant( `Aws\S3\Model\Grant` $grant )`

Add a Grant

#### Parameters

$grant
  ``Aws\S3\Model\Grant``
  $grant Grant to add

#### Returns

`mixed`
$this
# `public integer`
`count( )`

Get the total number of attributes

#### Returns

`integer`

#### Implementation of

`Countable::count()`
# `public `SplObjectStorage``
`getIterator( )`

Returns the grants for iteration

#### Returns

``SplObjectStorage``

#### Implementation of

`IteratorAggregate::getIterator()`
# `public mixed`
`updateCommand( `Guzzle\Service\Command\AbstractCommand` $command )`

Applies grant headers to a command's parameters

#### Parameters

$command
  ``Guzzle\Service\Command\AbstractCommand``
  $command Command to be updated

#### Returns

`mixed`
$this
# `public array`
`toArray( )`

Get the array representation of an object

#### Returns

`array`

#### Implementation of

`Guzzle\Common\ToArrayInterface::toArray()`

### Magic methods summary

## Properties summary

`protected `SplObjectStorage`` | $grants | # List of grants on the ACP
`protected `Aws\S3\Model\Grantee`` | $owner | # The owner of the ACP