alert = $value; } public function badge($value) { $this->badge = $value; } public function sound($value) { $this->sound = $value; } public function content_available($value) { $this->content_available = $value; } public function category($value) { $this->category = $value; } public function thread_id($value) { $this->thread_id = $value; } public function getFields() { return $this->fields; } public function buildFields() { $keys = array( 'alert', 'badge', 'sound', 'content-available', 'category', 'thread-id' ); foreach ($keys as $key) { $value = str_replace('-', '_', $key); PushLogConfig::getSingleInstance()->LogMessage('[' . __CLASS__ . '][before key:' . $key . '][after key:' . $value . ']', Constants::HW_PUSH_LOG_DEBUG_LEVEL); if (isset($this->$value)) { $this->fields[$key] = $this->$value; } } PushLogConfig::getSingleInstance()->LogMessage('[' . __CLASS__ . '][buildFields result:' . json_encode($this->fields), Constants::HW_PUSH_LOG_DEBUG_LEVEL); } }