Doctrine\OXM\Storage\FileSystemStorage::update PHP Method

update() public method

Update the XML in the filesystem with a specific identifier
public update ( ClassMetadataInfo $classMetadata, string $id, string $xmlContent ) : boolean
$classMetadata Doctrine\OXM\Mapping\ClassMetadataInfo
$id string
$xmlContent string
return boolean
    public function update(ClassMetadataInfo $classMetadata, $id, $xmlContent)
    {
        $this->prepareStoragePathForClass($this->resolveClassName($classMetadata));
        $filePath = $this->getFilename($classMetadata, $id);
        $result = file_put_contents($filePath, $xmlContent);
        if (false === $result) {
            // @codeCoverageIgnoreStart
            throw new StorageException("Entity '{$id}' could not be saved to the filesystem at '{$filePath}'");
            // @codeCoverageIgnoreEnd
        }
        return $result > 0;
    }