Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialDraft.php
<?php | <?php | ||||
final class DifferentialDraft extends DifferentialDAO { | final class DifferentialDraft extends DifferentialDAO { | ||||
protected $objectPHID; | protected $objectPHID; | ||||
protected $authorPHID; | protected $authorPHID; | ||||
protected $draftKey; | protected $draftKey; | ||||
public function getConfiguration() { | |||||
return array( | |||||
self::CONFIG_COLUMN_SCHEMA => array( | |||||
'draftKey' => 'text64', | |||||
), | |||||
self::CONFIG_KEY_SCHEMA => array( | |||||
'key_unique' => array( | |||||
'columns' => array('objectPHID', 'authorPHID', 'draftKey'), | |||||
'unique' => true, | |||||
), | |||||
), | |||||
) + parent::getConfiguration(); | |||||
} | |||||
public static function markHasDraft( | public static function markHasDraft( | ||||
$author_phid, | $author_phid, | ||||
$object_phid, | $object_phid, | ||||
$draft_key) { | $draft_key) { | ||||
try { | try { | ||||
id(new DifferentialDraft()) | id(new DifferentialDraft()) | ||||
->setObjectPHID($object_phid) | ->setObjectPHID($object_phid) | ||||
->setAuthorPHID($author_phid) | ->setAuthorPHID($author_phid) | ||||
Show All 35 Lines |