コード例 #1
0
ファイル: Stubs.php プロジェクト: nkapser/api-monetization
 /**
  * Returns true if this object is valid for an ad-request, false otherwise.
  */
 public function isValid()
 {
     if (StubValidator::isDoubleValid($this->lat) != true || StubValidator::isDoubleValid($this->lon) != true || StubValidator::isIntegerValid($this->accuracy) != true) {
         return false;
     }
     //check for lat-lon ranges
     if ($this->lat <= -90 || $this->lat >= 90) {
         return false;
     }
     if ($this->lon <= -180 || $this->lat >= 180) {
         return false;
     }
     if ($this->accuracy < 0) {
         return false;
     }
     return true;
 }