type; } /** * Number of times the reaction was added * * @return int */ public function getTotalCount(): int { return $this->total_count; } /** * @inheritDoc */ public function toArray(): array { return [ 'type' => $this->type->value, 'total_count' => $this->total_count ]; } /** * @inheritDoc */ public static function fromArray(?array $data): ?ObjectTypeInterface { if($data === null) { return null; } $object = new self(); $object->type = ReactionTypes::tryFrom($data['type']); $object->total_count = $data['total_count']; return $object; } }