Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phragment/storage/PhragmentSnapshotChild.php
<?php | <?php | ||||
final class PhragmentSnapshotChild extends PhragmentDAO | final class PhragmentSnapshotChild extends PhragmentDAO | ||||
implements PhabricatorPolicyInterface { | implements PhabricatorPolicyInterface { | ||||
protected $snapshotPHID; | protected $snapshotPHID; | ||||
protected $fragmentPHID; | protected $fragmentPHID; | ||||
protected $fragmentVersionPHID; | protected $fragmentVersionPHID; | ||||
private $snapshot = self::ATTACHABLE; | private $snapshot = self::ATTACHABLE; | ||||
private $fragment = self::ATTACHABLE; | private $fragment = self::ATTACHABLE; | ||||
private $fragmentVersion = self::ATTACHABLE; | private $fragmentVersion = self::ATTACHABLE; | ||||
public function getConfiguration() { | |||||
return array( | |||||
self::CONFIG_COLUMN_SCHEMA => array( | |||||
'fragmentVersionPHID' => 'phid?', | |||||
), | |||||
self::CONFIG_KEY_SCHEMA => array( | |||||
'key_child' => array( | |||||
'columns' => array( | |||||
'snapshotPHID', | |||||
'fragmentPHID', | |||||
'fragmentVersionPHID', | |||||
), | |||||
'unique' => true, | |||||
), | |||||
), | |||||
) + parent::getConfiguration(); | |||||
} | |||||
public function getSnapshot() { | public function getSnapshot() { | ||||
return $this->assertAttached($this->snapshot); | return $this->assertAttached($this->snapshot); | ||||
} | } | ||||
public function attachSnapshot(PhragmentSnapshot $snapshot) { | public function attachSnapshot(PhragmentSnapshot $snapshot) { | ||||
return $this->snapshot = $snapshot; | return $this->snapshot = $snapshot; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |