BaseRevisionBehavior

Type
Abstract Class
Namespace
craft\behaviors
Inherits
craft\behaviors\BaseRevisionBehavior » yii\base\Behavior » yii\base\BaseObject
Implements
yii\base\Configurable
Extended by
craft\behaviors\DraftBehavior, craft\behaviors\RevisionBehavior
Since
3.5.0

BaseRevisionBehavior is the base implementation of draft & revision behaviors.

View source

# Public Properties

Property Description
creator craft\elements\User, null
creatorId integer, null – The creator’s ID
owner yii\base\Component, null – The owner of this behavior
source craft\base\ElementInterface, null
sourceId integer, null – The source element’s ID

# creator

Type
craft\elements\User, null
Access
Read-only

View source

# creatorId

Type
integer, null

The creator’s ID

View source

# source

Type
craft\base\ElementInterface, null
Access
Read-only

View source

# sourceId

Type
integer, null

The source element’s ID

View source

# Public Methods

Method Description
__call() Calls the named method which is not a class method.
__construct() Constructor.
__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.
attach() Attaches the behavior object to the component.
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.
detach() Detaches the behavior object from the component.
events() Declares event handlers for the owner's events.
getCreator() Returns the draft’s creator.
getSource() Returns the draft/revision’s source element.
hasMethod() Returns a value indicating whether a method is defined.
hasProperty() Returns a value indicating whether a property is defined.
init() Initializes the object.
setCreator() Sets the draft's creator.

# getCreator()

Returns the draft’s creator.

View source

Returns

craft\elements\User, null

# getSource()

DEPRECATED

Deprecated in 3.2.9. Use craft\helpers\ElementHelper::sourceElement() instead.

Returns the draft/revision’s source element.

View source

Returns

craft\base\ElementInterface, null

# setCreator()

Since
3.5.0

Sets the draft's creator.

View source

Arguments

# Protected Methods

Method Description
source() Returns the source element.

# source()

Since
3.5.0

Returns the source element.

View source

Returns

craft\base\ElementInterface, null