public function setDomain($domain = null) { // validation for constraint: string if (!is_null($domain) && !is_string($domain)) { throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($domain)), __LINE__); } $this->Domain = $domain; return $this; }