public function toQueryParameters()
{
$data = array();
if ($this->in_reply_to) {
$data['in_reply_to'] = $this->in_reply_to;
}
if ($this->text) {
$data['text'] = $this->text;
}
if ($this->url) {
$data['url'] = $this->url;
}
$hashtags = $this->getHashtags();
if (!empty($hashtags)) {
$data['hashtags'] = implode(',', $hashtags);
}
unset($hashtags);
if ($this->via) {
$data['via'] = $this->via;
}
if (!empty($this->related)) {
$related_value = array();
foreach ($this->related as $username => $label) {
if ($label) {
$related_value[] = $username . ':' . $label;
} else {
$related_value[] = $username;
}
}
$data['related'] = implode(',', $related_value);
unset($related_value);
}
return $data;
}