public function delete()
 {
     $this->openTransaction();
     queryfx($this->establishConnection('w'), 'DELETE FROM %T WHERE src = %s AND type = %d', PhabricatorEdgeConfig::TABLE_NAME_EDGE, $this->getPHID(), PhabricatorMetaMTAMailHasRecipientEdgeType::EDGECONST);
     $ret = parent::delete();
     $this->saveTransaction();
     return $ret;
 }
 public function getConfiguration()
 {
     return array(self::CONFIG_SERIALIZATION => array('headers' => self::SERIALIZATION_JSON, 'bodies' => self::SERIALIZATION_JSON, 'attachments' => self::SERIALIZATION_JSON)) + parent::getConfiguration();
 }
 public function getConfiguration()
 {
     return array(self::CONFIG_SERIALIZATION => array('parameters' => self::SERIALIZATION_JSON)) + parent::getConfiguration();
 }
 public function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true) + parent::getConfiguration();
 }
 protected function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array('name' => 'text128', 'email' => 'text128', 'uri' => 'text255?'), self::CONFIG_KEY_SCHEMA => array('key_phid' => null, 'phid' => array('columns' => array('phid'), 'unique' => true), 'email' => array('columns' => array('email'), 'unique' => true), 'name' => array('columns' => array('name'), 'unique' => true))) + parent::getConfiguration();
 }
Пример #6
0
 protected function didWriteData()
 {
     parent::didWriteData();
     if (!$this->getWorkerTaskID()) {
         $mailer_task = new PhabricatorWorkerTask();
         $mailer_task->setTaskClass('PhabricatorMetaMTAWorker');
         $mailer_task->setData($this->getID());
         $mailer_task->save();
         $this->setWorkerTaskID($mailer_task->getID());
         $this->save();
     }
 }
Пример #7
0
 public function save()
 {
     if ($this->getID()) {
         return parent::save();
     }
     // NOTE: When mail is sent from CLI scripts that run tasks in-process, we
     // may re-enter this method from within scheduleTask(). The implementation
     // is intended to avoid anything awkward if we end up reentering this
     // method.
     $this->openTransaction();
     // Save to generate a task ID.
     $result = parent::save();
     // Queue a task to send this mail.
     $mailer_task = PhabricatorWorker::scheduleTask('PhabricatorMetaMTAWorker', $this->getID(), PhabricatorWorker::PRIORITY_ALERTS);
     $this->saveTransaction();
     return $result;
 }
Пример #8
0
 public function save()
 {
     if ($this->getID()) {
         return parent::save();
     }
     // NOTE: When mail is sent from CLI scripts that run tasks in-process, we
     // may re-enter this method from within scheduleTask(). The implementation
     // is intended to avoid anything awkward if we end up reentering this
     // method.
     $this->openTransaction();
     // Save to generate a mail ID and PHID.
     $result = parent::save();
     // Write the recipient edges.
     $editor = new PhabricatorEdgeEditor();
     $edge_type = PhabricatorMetaMTAMailHasRecipientEdgeType::EDGECONST;
     $recipient_phids = array_merge($this->getToPHIDs(), $this->getCcPHIDs());
     $expanded_phids = $this->expandRecipients($recipient_phids);
     $all_phids = array_unique(array_merge($recipient_phids, $expanded_phids));
     foreach ($all_phids as $curr_phid) {
         $editor->addEdge($this->getPHID(), $edge_type, $curr_phid);
     }
     $editor->save();
     // Queue a task to send this mail.
     $mailer_task = PhabricatorWorker::scheduleTask('PhabricatorMetaMTAWorker', $this->getID(), array('priority' => PhabricatorWorker::PRIORITY_ALERTS));
     $this->saveTransaction();
     return $result;
 }
 protected function getConfiguration()
 {
     return array(self::CONFIG_SERIALIZATION => array('headers' => self::SERIALIZATION_JSON, 'bodies' => self::SERIALIZATION_JSON, 'attachments' => self::SERIALIZATION_JSON), self::CONFIG_COLUMN_SCHEMA => array('relatedPHID' => 'phid?', 'authorPHID' => 'phid?', 'message' => 'text?', 'messageIDHash' => 'bytes12', 'status' => 'text32'), self::CONFIG_KEY_SCHEMA => array('relatedPHID' => array('columns' => array('relatedPHID')), 'authorPHID' => array('columns' => array('authorPHID')), 'key_messageIDHash' => array('columns' => array('messageIDHash')), 'key_created' => array('columns' => array('dateCreated')))) + parent::getConfiguration();
 }
 protected function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('configData' => self::SERIALIZATION_JSON), self::CONFIG_COLUMN_SCHEMA => array('address' => 'sort128'), self::CONFIG_KEY_SCHEMA => array('key_address' => array('columns' => array('address'), 'unique' => true), 'key_application' => array('columns' => array('applicationPHID')))) + parent::getConfiguration();
 }