class Stack extends AbstractStack (View source)

Represents a collection of stack operations for an organization.

Properties

string|null $name from  AbstractStack
StackOperation[] $stackOperations from  AbstractStack
(bool|float|int|string)[] $stackOptions from  AbstractStack
(bool|float|int|string)[] $stackVariables from  AbstractStack
string|null $organization
protected StackExpression[] $stackExpressions

Methods

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

Constructor.

null|string
getName()

Get name of stack for url.

setName(string $name)

No description

getStackOperationsByName(string $name)

Returns all operations matching name.

setStackOperations(array $operations)

No description

addStackOperation(StackOperation $stackOperation)

Adds a StackOperation to the list of existing Stack Operations.

(bool|float|int|string)[]
getStackOptions()

No description

setStackOptions(array $options)

No description

(bool|float|int|string)[]
getStackVariables()

No description

setStackVariables(array $variables)

No description

addStackOption(string $key, bool|float|int|string $value)

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

static Stack
createFromDecodedJsonResponse(array $data)

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

static Stack
createFromJsonResponse(string $data)

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

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

Creates a Stack object from an array.

string|null
getOrganization()

Get name of organization this stack belongs to.

setOrganization(null|string $organization)

No description

null|DateTime
getCreated()

Get date of creation for this stack.

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.

string
getDynamicUriString()

Returns the stack url part as a dynamic stack for previewing.

Details

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

Constructor.

You can also use the Stack::createFromConfig() helper static methods to create this object instead of the constructor directly

Parameters

string|null $organization

Organization name

$name
array $stackOperations
array $stackOptions
DateTime $created

Created at

See also

Stack::createFromConfig

null|string getName()

Get name of stack for url.

Return Value

null|string

AbstractStack setName(string $name)

Since: 1.1.0

No description

Parameters

string $name

Return Value

AbstractStack

StackOperation[] getStackOperations()

No description

Return Value

StackOperation[]

StackOperation[] getStackOperationsByName(string $name)

Since: 1.2.0

Returns all operations matching name.

Parameters

string $name

operation name

Return Value

StackOperation[]

AbstractStack setStackOperations(array $operations)

Since: 1.1.0

No description

Parameters

array $operations

Return Value

AbstractStack

AbstractStack addStackOperation(StackOperation $stackOperation)

Since: 1.1.0

Adds a StackOperation to the list of existing Stack Operations.

Parameters

StackOperation $stackOperation

Return Value

AbstractStack

(bool|float|int|string)[] getStackOptions()

No description

Return Value

(bool|float|int|string)[]

AbstractStack setStackOptions(array $options)

Since: 1.1.0

No description

Parameters

array $options

Return Value

AbstractStack

(bool|float|int|string)[] getStackVariables()

Since: 1.10.0

No description

Return Value

(bool|float|int|string)[]

AbstractStack setStackVariables(array $variables)

Since: 1.10.0

No description

Parameters

array $variables

Return Value

AbstractStack

AbstractStack addStackOption(string $key, bool|float|int|string $value)

Since: 1.1.0

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

Parameters

string $key
bool|float|int|string $value

Return Value

AbstractStack

static Stack createFromDecodedJsonResponse(array $data)

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

Parameters

array $data

Decoded JSON data

Return Value

Stack

static Stack createFromJsonResponse(string $data)

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

Parameters

string $data

JSON data

Return Value

Stack

static Stack createFromConfig(string $stackName, array $config, string|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

string $stackName
array $config
string|null $organization

Return Value

Stack

string|null getOrganization()

Get name of organization this stack belongs to.

Return Value

string|null

Stack setOrganization(null|string $organization)

Since: 1.1.0

No description

Parameters

null|string $organization

Return Value

Stack

null|DateTime getCreated()

Get date of creation for this stack.

Return Value

null|DateTime

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.

The values of the keys are objects for operations and expressions.

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

Return Value

array

string getDynamicUriString()

Since: 1.2.0

Returns the stack url part as a dynamic stack for previewing.

Return Value

string

Exceptions

RuntimeException