Skip to content

Commit

Permalink
Add deprecated and research flags to Packet class
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbennett committed Dec 27, 2019
1 parent 6671171 commit dae890f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/libraries/Packet.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class Packet implements JsonSerializable {
const DIRECTION_SERVER_CLIENT = 2;
const DIRECTION_PEER_TO_PEER = 3;

const OPTION_MARKDOWN = 0x00000001;
const OPTION_PUBLISHED = 0x00000002;
const OPTION_MARKDOWN = 0x00000001;
const OPTION_PUBLISHED = 0x00000002;
const OPTION_DEPRECATED = 0x00000004;
const OPTION_RESEARCH = 0x00000008;

protected $created_datetime;
protected $edited_count;
Expand Down Expand Up @@ -559,6 +561,18 @@ public function getUserId() {
return $this->user_id;
}

public function isDeprecated() {
return ($this->options_bitmask & self::OPTION_DEPRECATED);
}

public function isInResearch() {
return ($this->options_bitmask & self::OPTION_RESEARCH);
}

public function isPublished() {
return ($this->options_bitmask & self::OPTION_PUBLISHED);
}

public function jsonSerialize() {
return [
'created_datetime' => $this->getCreatedDateTime(),
Expand Down

0 comments on commit dae890f

Please sign in to comment.