1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00
phorge-phorge/src/applications/draft/storage/PhabricatorDraft.php

32 lines
738 B
PHP
Raw Normal View History

2011-02-06 01:57:21 +01:00
<?php
final class PhabricatorDraft extends PhabricatorDraftDAO {
2011-02-06 01:57:21 +01:00
protected $authorPHID;
protected $draftKey;
protected $draft;
protected $metadata = array();
public function getConfiguration() {
return array(
self::CONFIG_SERIALIZATION => array(
'metadata' => self::SERIALIZATION_JSON,
),
) + parent::getConfiguration();
}
2011-02-06 01:57:21 +01:00
public function replaceOrDelete() {
if ($this->draft == '' && !array_filter($this->metadata)) {
queryfx(
$this->establishConnection('w'),
'DELETE FROM %T WHERE authorPHID = %s AND draftKey = %s',
$this->getTableName(),
$this->authorPHID,
$this->draftKey);
return $this;
}
return parent::replace();
}
2011-02-06 01:57:21 +01:00
}