EntryRevisions ​
- Type
- Class
- Namespace
- craft\services
- Inherits
- craft\services\EntryRevisions » yii\base\Component » yii\base\BaseObject
- Implements
- yii\base\Configurable
- Since
- 3.0.0
- Deprecated in
- in 3.2.0
Entry Revisions service.
An instance of the service is available via Craft::$app->entryRevisions.
Public Properties ​
| Property | Description |
|---|---|
| behaviors | yii\base\Behavior – List of behaviors attached to this component. |
Public Methods ​
| Method | Description |
|---|---|
| __call() | Calls the named method which is not a class method. |
| __clone() | This method is called after the object is created by cloning an existing one. |
| __construct() | Constructor. |
| __get() | Returns the value of a component property. |
| __isset() | Checks if a property is set, i.e. defined and not null. |
| __set() | Sets the value of a component property. |
| __unset() | Sets a component property to be null. |
| attachBehavior() | Attaches a behavior to this component. |
| attachBehaviors() | Attaches a list of behaviors to the component. |
| behaviors() | Returns a list of behaviors that this component should behave as. |
| canGetProperty() | Returns a value indicating whether a property can be read. |
| canSetProperty() | Returns a value indicating whether a property can be set. |
| className() | Returns the fully qualified name of this class. |
| detachBehavior() | Detaches a behavior from the component. |
| detachBehaviors() | Detaches all behaviors from the component. |
| doesEntryHaveVersions() | Returns whether an entry has any versions stored. |
| ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. |
| getBehavior() | Returns the named behavior object. |
| getBehaviors() | Returns all behaviors attached to this component. |
| getDraftById() | Returns a draft by its ID. |
| getDraftsByEntryId() | Returns drafts of a given entry. |
| getEditableDraftsByEntryId() | Returns the drafts of a given entry that are editable by the current user. |
| getVersionById() | Returns a version by its ID. |
| getVersionsByEntryId() | Returns versions by an entry ID. |
| hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. |
| hasMethod() | Returns a value indicating whether a method is defined. |
| hasProperty() | Returns a value indicating whether a property is defined for this component. |
| init() | Initializes the object. |
| off() | Detaches an existing event handler from this component. |
| on() | Attaches an event handler to an event. |
| trigger() | Triggers an event. |
doesEntryHaveVersions() ​
DEPRECATED
Deprecated in 3.2.0. Use an entry query instead.
Returns whether an entry has any versions stored.
Arguments ​
$entryId(integer) – The entry ID to search for$siteId(integer, null) – The site ID to search for
Returns ​
getDraftById() ​
DEPRECATED
Deprecated in 3.2.0. Use an entry query instead.
Returns a draft by its ID.
Arguments ​
$draftId(integer)
Returns ​
getDraftsByEntryId() ​
DEPRECATED
Deprecated in 3.2.0. Use an entry query instead.
Returns drafts of a given entry.
Arguments ​
$entryId(integer)$siteId(integer, null)$withContent(boolean) – Whether the field content should be included on the drafts
Returns ​
getEditableDraftsByEntryId() ​
DEPRECATED
Deprecated in 3.2.0. Use craft\services\Drafts::getEditableDrafts() instead.
Returns the drafts of a given entry that are editable by the current user.
Arguments ​
Returns ​
Throws ​
getVersionById() ​
DEPRECATED
Deprecated in 3.2.0. Use an entry query instead.
Returns a version by its ID.
Arguments ​
$versionId(integer)
Returns ​
getVersionsByEntryId() ​
DEPRECATED
Deprecated in 3.2.0. Use an entry query instead.
Returns versions by an entry ID.
Arguments ​
$entryId(integer) – The entry ID to search for.$siteId(integer, null) – The site ID to search for.$limit(integer, null) – The limit on the number of versions to retrieve.$includeCurrent(boolean) – Whether to include the current "top" version of the entry.$withContent(boolean) – Whether the field content should be included on the versions
Returns ​
Events ​
EVENT_AFTER_DELETE_DRAFT ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\DraftEvent
The event that is triggered after a draft is deleted.
EVENT_AFTER_PUBLISH_DRAFT ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\DraftEvent
The event that is triggered after a draft is published.
EVENT_AFTER_REVERT_ENTRY_TO_VERSION ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\VersionEvent
The event that is triggered after an entry is reverted to an old version.
EVENT_AFTER_SAVE_DRAFT ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\DraftEvent
The event that is triggered after a draft is saved.
EVENT_BEFORE_DELETE_DRAFT ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\DraftEvent
The event that is triggered before a draft is deleted.
EVENT_BEFORE_PUBLISH_DRAFT ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\DraftEvent
The event that is triggered before a draft is published.
EVENT_BEFORE_REVERT_ENTRY_TO_VERSION ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\VersionEvent
The event that is triggered before an entry is reverted to an old version.
EVENT_BEFORE_SAVE_DRAFT ​
DEPRECATED
Deprecated in 3.2.0
- Type
craft\services\DraftEvent
The event that is triggered before a draft is saved.