[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class ConpherenceParticipant extends ConpherenceDAO { 4 5 protected $participantPHID; 6 protected $conpherencePHID; 7 protected $participationStatus; 8 protected $behindTransactionPHID; 9 protected $seenMessageCount; 10 protected $dateTouched; 11 protected $settings = array(); 12 13 public function getConfiguration() { 14 return array( 15 self::CONFIG_SERIALIZATION => array( 16 'settings' => self::SERIALIZATION_JSON, 17 ), 18 self::CONFIG_COLUMN_SCHEMA => array( 19 'participationStatus' => 'uint32', 20 'dateTouched' => 'epoch', 21 'seenMessageCount' => 'uint64', 22 ), 23 self::CONFIG_KEY_SCHEMA => array( 24 'conpherencePHID' => array( 25 'columns' => array('conpherencePHID', 'participantPHID'), 26 'unique' => true, 27 ), 28 'unreadCount' => array( 29 'columns' => array('participantPHID', 'participationStatus'), 30 ), 31 'participationIndex' => array( 32 'columns' => array('participantPHID', 'dateTouched', 'id'), 33 ), 34 ), 35 ) + parent::getConfiguration(); 36 } 37 38 public function getSettings() { 39 return nonempty($this->settings, array()); 40 } 41 42 public function markUpToDate( 43 ConpherenceThread $conpherence, 44 ConpherenceTransaction $xaction) { 45 if (!$this->isUpToDate($conpherence)) { 46 $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); 47 $this->setBehindTransactionPHID($xaction->getPHID()); 48 $this->setSeenMessageCount($conpherence->getMessageCount()); 49 $this->save(); 50 } 51 return $this; 52 } 53 54 private function isUpToDate(ConpherenceThread $conpherence) { 55 return 56 ($this->getSeenMessageCount() == $conpherence->getMessageCount()) 57 && 58 ($this->getParticipationStatus() == 59 ConpherenceParticipationStatus::UP_TO_DATE); 60 } 61 62 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |