private function getIdentityForAliasedObject($object)
    {
        $originalObject = (new \ReflectionClass($this->className))->newInstanceWithoutConstructor();
        
        $this->copyFields($object, $originalObject);
        $id =$this->identifier->getIdentity($originalObject);
        $this->copyFields($originalObject, $object);

        return $id;
    }
private function getIdentityForAliasedObject($object)
    {
        $originalObject = (new \ReflectionClass($this->className))->newInstanceWithoutConstructor();
        
        $this->copyFields($object, $originalObject);
        $id =$this->identifier->getIdentity($originalObject);
        $this->copyFields($originalObject, $object);

        return $id;
    }
@param object $object

@return mixed