class Stack (View source)

Represents a collection of stack operations for an organization.

Properties

string|null $organization
string $name
DateTime $created
StackOperation[] $stackOperations
array $stackOptions
protected StackExpression[] $stackExpressions

Methods

__construct(string|null $organization = null, string|null $name = null, array $stackOperations = [], array $stackOptions = [], DateTime $created = null)

Constructor.

static Stack
createFromJsonResponse(string|array $data, bool $isArray = false)

Create a stack from the JSON data returned by the rokka.io API.

static Stack
createFromConfig($stackName, array $config, null $organization = null)

Creates a Stack object from an array.

string
getOrganization()

Get name of organization this stack belongs to.

setOrganization(null|string $organization)

No description

string
getName()

Get name of stack for url.

setName(string $name)

No description

getCreated()

Get date of creation for this stack.

getStackOperations()

No description

setStackOperations(array $operations)

No description

addStackOperation(StackOperation $stackOperation)

Adds a StackOperation to the list of existing Stack Operations.

array
getStackOptions()

No description

setStackOptions(array $options)

No description

addStackOption(string $key, mixed $value)

Sets a single Stack option to the list of existing Stack options.

setStackExpressions(array $stackExpressions)

No description

addStackExpression(StackExpression $stackExpression)

Adds a Stack Expression to the list of existing Stack Expression.

array
getConfig()

Gets stack operations / options / expressions as one array.

Details

__construct(string|null $organization = null, string|null $name = null, array $stackOperations = [], array $stackOptions = [], DateTime $created = null)

Constructor.

It's recommended to use one of the helper static methods to create this object instead of the constructor directly

Parameters

string|null $organization

Organization name

string|null $name

Stack name

array $stackOperations

Collection of stack operations

array $stackOptions

Collection of stack options

DateTime $created

Created at

See also

Stack::createFromConfig

static Stack createFromJsonResponse(string|array $data, bool $isArray = false)

Create a stack from the JSON data returned by the rokka.io API.

Parameters

string|array $data

JSON data

bool $isArray

If the data provided is already an array

Return Value

Stack

static Stack createFromConfig($stackName, array $config, null $organization = null)

Since: 1.1.0

Creates a Stack object from an array.

$config = ['operations' => StackOperation[] 'options' => $options, 'expressions' => $expressions ]

All are optional, if operations doesn't exist, it will be a noop operation.

Parameters

$stackName
array $config
null $organization

Return Value

Stack

string getOrganization()

Get name of organization this stack belongs to.

Return Value

string

Stack setOrganization(null|string $organization)

Since: 1.1.0

No description

Parameters

null|string $organization

Return Value

Stack

string getName()

Get name of stack for url.

Return Value

string

Stack setName(string $name)

Since: 1.1.0

No description

Parameters

string $name

Return Value

Stack

DateTime getCreated()

Get date of creation for this stack.

Return Value

DateTime

StackOperation[] getStackOperations()

No description

Return Value

StackOperation[]

Stack setStackOperations(array $operations)

Since: 1.1.0

No description

Parameters

array $operations

Return Value

Stack

Stack addStackOperation(StackOperation $stackOperation)

Since: 1.1.0

Adds a StackOperation to the list of existing Stack Operations.

Parameters

StackOperation $stackOperation

Return Value

Stack

array getStackOptions()

No description

Return Value

array

Stack setStackOptions(array $options)

Since: 1.1.0

No description

Parameters

array $options

Return Value

Stack

Stack addStackOption(string $key, mixed $value)

Since: 1.1.0

Sets a single Stack option to the list of existing Stack options.

Parameters

string $key
mixed $value

Return Value

Stack

Stack setStackExpressions(array $stackExpressions)

Since: 1.1.0

No description

Parameters

array $stackExpressions

Return Value

Stack

Stack addStackExpression(StackExpression $stackExpression)

Since: 1.1.0

Adds a Stack Expression to the list of existing Stack Expression.

Parameters

StackExpression $stackExpression

Return Value

Stack

StackExpression[] getStackExpressions()

Since: 1.1.0

No description

Return Value

StackExpression[]

array getConfig()

Since: 1.1.0

Gets stack operations / options / expressions as one array.

Useful for using this to sent as json to the Rokka API

Return Value

array