Code Duplication    Length = 11-12 lines in 2 locations

model/versioning/Versioned.php 2 locations

@@ 1483-1494 (lines=12) @@
1480
	 *
1481
	 * @return bool True if publish was successful
1482
	 */
1483
	public function publishSingle() {
1484
		$owner = $this->owner;
1485
		if(!$owner->canPublish()) {
1486
			return false;
1487
		}
1488
1489
		$owner->invokeWithExtensions('onBeforePublish');
1490
		$owner->write();
1491
		$owner->copyVersionToStage(static::DRAFT, static::LIVE);
1492
		$owner->invokeWithExtensions('onAfterPublish');
1493
		return true;
1494
	}
1495
1496
	/**
1497
	 * Set foreign keys of has_many objects to 0 where those objects were
@@ 1639-1649 (lines=11) @@
1636
	 *
1637
	 * @return bool True if the revert was successful
1638
	 */
1639
	public function doRevertToLive() {
1640
		$owner = $this->owner;
1641
		if(!$owner->canRevertToLive()) {
1642
			return false;
1643
		}
1644
1645
		$owner->invokeWithExtensions('onBeforeRevertToLive');
1646
		$owner->copyVersionToStage(static::LIVE, static::DRAFT, false);
1647
		$owner->invokeWithExtensions('onAfterRevertToLive');
1648
		return true;
1649
	}
1650
1651
	/**
1652
	 * Trigger revert of all owned objects to stage