public function ScheduledTransition::setEntity in Scheduled Transitions 2.x
Set the revision this scheduled transition is for.
Parameters
\Drupal\Core\Entity\RevisionableInterface $revision: The revision to be transitioned.
Return value
static Returns entity for chaining.
Overrides ScheduledTransitionInterface::setEntity
File
- src/
Entity/ ScheduledTransition.php, line 157
Class
- ScheduledTransition
- Scheduled Transition entity.
Namespace
Drupal\scheduled_transitions\EntityCode
public function setEntity(RevisionableInterface $revision) {
$this
->set('entity', $revision);
$this
->setEntityRevisionId($revision
->getRevisionId());
$this
->setEntityRevisionLanguage($revision
->language()
->getId());
return $this;
}