public function setSite(Site $site)
    {
        if ($this->site || $site->getId() !== $this->getSiteId()) {
            throw new \LogicException("this object is not really immutable, but it should be, site is already set anyway");
        }

        $this->site = $site;
    }
public function setSite(Site $site)
    {
        if ($this->site || $site->getId() !== $this->getSiteId()) {
            throw new \LogicException("this object is not really immutable, but it should be, site is already set anyway");
        }

        $this->site = $site;
    }
public function setSite ( Site $ site ) { if ( $ this -> site || $ site -> getId ( ) !== $ this -> getSiteId ( ) ) { throw new \ LogicException ( "this object is not really immutable, but it should be, site is already set anyway" ) ; } $ this -> site = $ site ; }
Set preloaded site

@param Site $site
Set preloaded site