public function setMetadata(Resource $metadata, bool $fixReferences = false) {
        $this->metadata = $metadata;
        $this->updated  = false;

        $this->extractAclFromMetadata();

        $this->fedora->getCache()->reload($this);

        if ($fixReferences) {
            $this->fedora->fixMetadataReferences($this->metadata);
        }
    }