class Version extends ConcreteObject implements ObjectInterface, ObjectInterface (View source)

Traits

Properties

$error from  ConcreteObject
int|string deprecated $cvID
bool|int|string deprecated $cvIsApproved
bool|int|string deprecated $cvIsNew
string|null $cvHandle

The collection version handle.

string|null deprecated $cvName
string|null $cvDescription

The collection version description.

string|null deprecated $cvDateCreated
string|null $cvDatePublic

The date/time when this collection version was made public.

int|string $pTemplateID

The ID of the page template.

int|string|null deprecated $cvAuthorUID
int|string|null deprecated $cvApproverUID
string|null deprecated $cvComments
int|string $pThemeID

The ID of the page theme.

string|null deprecated $cvPublishDate
string|null deprecated $cvPublishEndDate
string|null deprecated $cvDateApproved
int deprecated $cID
protected $attributes
$layoutStyles
protected bool|null $isMostRecent

Is this the most recent version?

protected array|null $customAreaStyles

The custom area style IDs.

Methods

loadError($error)

No description

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

static 
camelcase($file)

No description

static 
uncamelcase($string)

No description

getAttributeValueObject(AttributeKeyInterface|string $ak, bool $createIfNotExists = false)

No description

getAttribute($ak, $mode = false)

No description

Value
getAttributeValue($ak)

No description

clearAttribute($ak, bool $doReindexImmediately = true)

No description

Value
setAttribute($ak, mixed $value, bool $doReindexImmediately = true)

Sets the attribute of a user info object to the specified value, and saves it in the database.

refreshCache()

Clear the cache for this collection.

static Version
get(Collection $c, int|string $cvID)

Get a Version instance given the Collection and a version identifier.

bool|int|string
isApproved()

Is this version approved?

bool
isApprovedNow($when = null)

Is this version approved and in the publish interval?

string|null
getPublishDate()

Get the scheduled date/time when the collection is published: start.

string|null
getPublishEndDate()

Get the scheduled date/time when the collection is published: end.

bool
isMostRecent()

Is this the most recent version?

bool|number|string
isNew()

Is this a new version?

int|string
getVersionID()

Get the collection version ID.

int
getCollectionID()

Get the collection ID.

string|null
getVersionName()

The collection version name.

string|null
getVersionComments()

Get the collection version comments.

int|string|null
getVersionAuthorUserID()

Get the ID of the user that created this collection version.

int|string|null
getVersionApproverUserID()

Get the ID of the user that approved this collection version.

string|null|false
getVersionAuthorUserName()

Get the name of the user that approved this collection version.

string|null|false
getVersionApproverUserName()

Get the name of the user that approved this collection version.

array
getCustomAreaStyles()

Get the custom area style IDs.

string|null
getVersionDateCreated()

Get the date/time when the collection version was created.

string|null
getVersionDateApproved()

Get the date the collection version was approved.

setComment(string $comment)

Set the collection version comments.

setPublishDate(string|DateTime|int|null $publishDate)

Set the scheduled date/time when the collection is published: start.

setPublishEndDate(string|DateTime|int|null $publishEndDate)

Set the scheduled date/time when the collection is published: end.

setPublishInterval(string|DateTime|int|null $startDateTime, string|DateTime|int|null $endDateTime)

Set the scheduled date/time when the collection is published.

createNew(string $versionComments)

Create a new version for the same collection as this collection version.

approve(bool $doReindexImmediately = true, string|DateTime|int|null $cvPublishDate = null, string|DateTime|int|null $cvPublishEndDate = null)

Approve this collection version.

discard()

Discard my most recent edit that is pending.

bool
canDiscard()

Check if this collection version can be discarded.

removeNewStatus()

Mark this collection version as not new.

deny()

Mark this collection version as not approved.

delete()

Delete this version and its related data (blocks, feature assignments, attributes, custom styles, ...).

avoidApprovalOverlapping()

Make sure that other collection versions aren't approved and valid at the same time as this version.

Details

loadError($error)

No description

Parameters

$error

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

Parameters

$arr

static camelcase($file)

No description

Parameters

$file

static uncamelcase($string)

No description

Parameters

$string

CategoryInterface getObjectAttributeCategory()

AttributeValueInterface|null getAttributeValueObject(AttributeKeyInterface|string $ak, bool $createIfNotExists = false)

No description

Parameters

AttributeKeyInterface|string $ak

An attribute key instance (or its handle)

bool $createIfNotExists

Shall the generic attribute value be created if it does not already exist?

Return Value

AttributeValueInterface|null

See also

ObjectInterface::getAttributeValueObject

getAttribute($ak, $mode = false)

No description

Parameters

$ak
$mode

Value getAttributeValue($ak)

No description

Parameters

$ak

Return Value

Value

clearAttribute($ak, bool $doReindexImmediately = true)

No description

Parameters

$ak
bool $doReindexImmediately

Value setAttribute($ak, mixed $value, bool $doReindexImmediately = true)

Sets the attribute of a user info object to the specified value, and saves it in the database.

Parameters

$ak
mixed $value
bool $doReindexImmediately

Return Value

Value

getPermissionObjectIdentifier()

getPermissionResponseClassName()

getPermissionAssignmentClassName()

getPermissionObjectKeyCategoryHandle()

refreshCache()

Clear the cache for this collection.

static Version get(Collection $c, int|string $cvID)

Get a Version instance given the Collection and a version identifier.

Parameters

Collection $c

the collection for which you want the version

int|string $cvID

the specific version ID (or 'ACTIVE', 'SCHEDULED', 'RECENT')

Return Value

Version

bool|int|string isApproved()

Is this version approved?

Return Value

bool|int|string

See also

isApprovedNow()

bool isApprovedNow($when = null)

Is this version approved and in the publish interval?

Parameters

$when

Return Value

bool

string|null getPublishDate()

Get the scheduled date/time when the collection is published: start.

Return Value

string|null

Examples

'2018-21-31 23:59:59'

string|null getPublishEndDate()

Get the scheduled date/time when the collection is published: end.

Return Value

string|null

Examples

'2018-21-31 23:59:59'

bool isMostRecent()

Is this the most recent version?

Return Value

bool

bool|number|string isNew()

Is this a new version?

Return Value

bool|number|string

int|string getVersionID()

Get the collection version ID.

Return Value

int|string

int getCollectionID()

Get the collection ID.

Return Value

int

string|null getVersionName()

The collection version name.

Return Value

string|null

string|null getVersionComments()

Get the collection version comments.

Return Value

string|null

int|string|null getVersionAuthorUserID()

Get the ID of the user that created this collection version.

Return Value

int|string|null

int|string|null getVersionApproverUserID()

Get the ID of the user that approved this collection version.

Return Value

int|string|null

string|null|false getVersionAuthorUserName()

Get the name of the user that approved this collection version.

Return Value

string|null|false

return NULL if there's no author, false if it has been deleted, or a string otherwise

string|null|false getVersionApproverUserName()

Get the name of the user that approved this collection version.

Return Value

string|null|false

return NULL if there's no author, false if it has been deleted, or a string otherwise

array getCustomAreaStyles()

Get the custom area style IDs.

Return Value

array

key: area handle, value: the inline stle set ID

string|null getVersionDateCreated()

Get the date/time when the collection version was created.

Return Value

string|null

Examples

'2018-21-31 23:59:59'

string|null getVersionDateApproved()

Get the date the collection version was approved.

Return Value

string|null

Examples

'2018-21-31 23:59:59'

setComment(string $comment)

Set the collection version comments.

Parameters

string $comment

setPublishDate(string|DateTime|int|null $publishDate)

Set the scheduled date/time when the collection is published: start.

Parameters

string|DateTime|int|null $publishDate

the scheduled date/time when the collection is published (start)

Exceptions

UserMessageException

setPublishEndDate(string|DateTime|int|null $publishEndDate)

Set the scheduled date/time when the collection is published: end.

Parameters

string|DateTime|int|null $publishEndDate

the scheduled date/time when the collection is published (end)

Exceptions

UserMessageException

setPublishInterval(string|DateTime|int|null $startDateTime, string|DateTime|int|null $endDateTime)

Set the scheduled date/time when the collection is published.

Parameters

string|DateTime|int|null $startDateTime

the scheduled date/time when the collection is published (start)

string|DateTime|int|null $endDateTime

the scheduled date/time when the collection is published (end)

Exceptions

UserMessageException

Version createNew(string $versionComments)

Create a new version for the same collection as this collection version.

Parameters

string $versionComments

the new collection version comments

Return Value

Version

approve(bool $doReindexImmediately = true, string|DateTime|int|null $cvPublishDate = null, string|DateTime|int|null $cvPublishEndDate = null)

Approve this collection version.

Parameters

bool $doReindexImmediately

reindex the collection contents now? Otherwise it's reindexing will just be scheduled

string|DateTime|int|null $cvPublishDate

the scheduled date/time when the collection is published (start)

string|DateTime|int|null $cvPublishEndDate

the scheduled date/time when the collection is published (end)

Exceptions

UserMessageException

discard()

Discard my most recent edit that is pending.

bool canDiscard()

Check if this collection version can be discarded.

Return Value

bool

removeNewStatus()

Mark this collection version as not new.

deny()

Mark this collection version as not approved.

delete()

Delete this version and its related data (blocks, feature assignments, attributes, custom styles, ...).

private avoidApprovalOverlapping()

Make sure that other collection versions aren't approved and valid at the same time as this version.