- craft\services\EntryRevisions » yii\base\Component » yii\base\BaseObject
Entry Revisions service.
An instance of the Entry Revisions service is globally accessible in Craft via
|__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.|
|__get()||Returns the value of an object property.|
|__isset()||Checks if a property is set, i.e. defined and not null.|
|__set()||Sets value of an object property.|
|__unset()||Sets an object property to 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.|
|deleteDraft()||Deletes a draft by it's model.|
|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.|
|init()||Initializes the object.|
|off()||Detaches an existing event handler from this component.|
|on()||Attaches an event handler to an event.|
|publishDraft()||Publishes a draft.|
|revertEntryToVersion()||Reverts an entry to a version.|
|saveDraft()||Saves a draft.|
|saveVersion()||Saves a new version.|
|trigger()||Triggers an event.|
Deletes a draft by it's model.
$draft(craft\models\EntryDraft) – The draft to be deleted
boolean – Whether the draft was deleted successfully
Returns whether an entry has any versions stored.
Returns a draft by its ID.
Returns drafts of a given entry.
Returns the drafts of a given entry that are editable by the current user.
Returns a version by its ID.
Returns versions by an entry ID.
$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
Publishes a draft.
Reverts an entry to a version.
Saves a draft.
Saves a new version.
|compareRevisionData()||Compares two revisions' data and returns whether it has changed.|
Compares two revisions' data and returns whether it has changed.
boolean – Whether it looks like something has changed
The event that is triggered after a draft is deleted.
The event that is triggered after a draft is published.
The event that is triggered after an entry is reverted to an old version.
The event that is triggered after a draft is saved.
The event that is triggered before a draft is deleted.
The event that is triggered before a draft is published.
The event that is triggered before an entry is reverted to an old version.
The event that is triggered before a draft is saved.