public function setResourceIdentity(ResourceIdentity $identity): void
    {
        if ($this->resourceIdentity !== null) {
            throw new RuntimeException('The resource identity has already been set.');
        }

        $this->resourceIdentity = $identity;
    }
public function setResourceIdentity(ResourceIdentity $identity): void
    {
        if ($this->resourceIdentity !== null) {
            throw new RuntimeException('The resource identity has already been set.');
        }

        $this->resourceIdentity = $identity;
    }
public function setResourceIdentity ( ResourceIdentity $ identity ) : void { if ( $ this -> resourceIdentity !== null ) { throw new RuntimeException ( 'The resource identity has already been set.' ) ; } $ this -> resourceIdentity = $ identity ; }
Set the identity of the resource.

@throws \RuntimeException if the resource identity has already been set.
Set the identity of the resource .