public function setHost($host)
    {
        if ($host instanceof Binary && $host->getType() == Binary::TYPE_UUID) {
            return $this->{$this->createdByAttribute} = $host;
        }
        if ($host instanceof $this->hostClass || $host instanceof IdentityInterface) {
            return $this->{$this->createdByAttribute} = new Binary($host->getGUID(), Binary::TYPE_UUID);
        }
        if (is_string($host) && preg_match(Number::GUID_REGEX, $host)) {
            return $this->{$this->createdByAttribute} = new Binary(Number::guid_bin($host), Binary::TYPE_UUID);
        }
        if (strlen($host) == 16) {
            return $this->{$this->createdByAttribute} = new Binary($host, Binary::TYPE_UUID);
        }
        return false;
    }
public function setHost($host)
    {
        if ($host instanceof Binary && $host->getType() == Binary::TYPE_UUID) {
            return $this->{$this->createdByAttribute} = $host;
        }
        if ($host instanceof $this->hostClass || $host instanceof IdentityInterface) {
            return $this->{$this->createdByAttribute} = new Binary($host->getGUID(), Binary::TYPE_UUID);
        }
        if (is_string($host) && preg_match(Number::GUID_REGEX, $host)) {
            return $this->{$this->createdByAttribute} = new Binary(Number::guid_bin($host), Binary::TYPE_UUID);
        }
        if (strlen($host) == 16) {
            return $this->{$this->createdByAttribute} = new Binary($host, Binary::TYPE_UUID);
        }
        return false;
    }
public function setHost ( $ host ) { if ( $ host instanceof Binary && $ host -> getType ( ) == Binary :: TYPE_UUID ) { return $ this -> { $ this -> createdByAttribute } = $ host ; } if ( $ host instanceof $ this -> hostClass || $ host instanceof IdentityInterface ) { return $ this -> { $ this -> createdByAttribute } = new Binary ( $ host -> getGUID ( ) , Binary :: TYPE_UUID ) ; } if ( is_string ( $ host ) && preg_match ( Number :: GUID_REGEX , $ host ) ) { return $ this -> { $ this -> createdByAttribute } = new Binary ( Number :: guid_bin ( $ host ) , Binary :: TYPE_UUID ) ; } if ( strlen ( $ host ) == 16 ) { return $ this -> { $ this -> createdByAttribute } = new Binary ( $ host , Binary :: TYPE_UUID ) ; } return false ; }
Set host.
@param Binary|IdentityInterface|string $host
@return Binary|false
Set host .