/** * Display * @return string */ public function code() { if ($this->WindSpeed->isUnknown() && $this->WindDegree->isUnknown()) { return ''; } $code = '<span class="' . self::BASE_CLASS . '"' . $this->tooltipAttributes() . '>'; if (!$this->WindDegree->isUnknown()) { $code .= '<span class="' . self::DIRECTION_CLASS . '" style="transform:rotate(' . $this->WindDegree->value() . 'deg);"></span> '; } $code .= $this->WindSpeed->isUnknown() ? '?' : $this->WindSpeed->string(false); $code .= '</span>'; return $code; }
/** * Clear weather */ public function clear() { $this->Temperature->setTemperature(null); $this->Condition->set(Condition::UNKNOWN); $this->WindSpeed->set(null); $this->WindDegree->set(null); $this->Humidity->set(null); $this->Pressure->set(null); }
/** * Is the weather-data empty? * @return bool */ public function isEmpty() { return $this->Temperature->isUnknown() && $this->Condition->isUnknown() && $this->WindSpeed->isUnknown() && $this->WindDegree->isUnknown() && $this->Humidity->isUnknown() && $this->Pressure->isUnknown(); }