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

Traits

Properties

$error from ConcreteObject
int|string $cvID
bool|int|string $cvIsApproved
bool|int|string $cvIsNew
string|null $cvHandle The collection version handle.
string|null $cvName
string|null $cvDescription The collection version description.
string|null $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 $cvAuthorUID
int|string|null $cvApproverUID
string|null $cvComments
int|string $pThemeID The ID of the page theme.
string|null $cvPublishDate
string|null $cvPublishEndDate
string|null $cvDateApproved
int $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

Value
setAttribute(AttributeKeyInterface $ak, mixed $value)

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)

Parameters

$error

isError()

getError()

setPropertiesFromArray($arr)

Parameters

$arr

static camelcase($file)

Parameters

$file

static uncamelcase($string)

Parameters

$string

CategoryInterface getObjectAttributeCategory()

Return Value

CategoryInterface

See also

\Concrete\Core\Attribute\ObjectInterface::getObjectAttributeCategory()

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

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

\Concrete\Core\Attribute\ObjectInterface::getAttributeValueObject()

getAttribute($ak, $mode = false)

Parameters

$ak
$mode

Value getAttributeValue($ak)

Parameters

$ak

Return Value

Value

clearAttribute(AttributeKeyInterface $ak)

Parameters

AttributeKeyInterface $ak | string $ak

Value setAttribute(AttributeKeyInterface $ak, mixed $value)

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

Parameters

AttributeKeyInterface $ak | string $ak
mixed $value

Return Value

Value

getPermissionObjectIdentifier()

See also

\Concrete\Core\Permission\ObjectInterface::getPermissionObjectIdentifier()

getPermissionResponseClassName()

See also

\Concrete\Core\Permission\ObjectInterface::getPermissionResponseClassName()

getPermissionAssignmentClassName()

See also

\Concrete\Core\Permission\ObjectInterface::getPermissionAssignmentClassName()

getPermissionObjectKeyCategoryHandle()

See also

\Concrete\Core\Permission\ObjectInterface::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

string|null getPublishEndDate()

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

Return Value

string|null

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

string|null getVersionDateApproved()

Get the date the collection version was approved.

Return Value

string|null

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 if the start of the publish date/time is its end.

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 if the start of the publish date/time is its end.

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 if the start of the publish date/time is its end.

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 if the start of the publish date/time is its end.

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.