Current path: home/webdevt/www/schtroumpf.fr/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/Persister/Collection/
?? Go up: /home/webdevt/www/schtroumpf.fr/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/Persister
<?php
declare(strict_types=1);
namespace Doctrine\ORM\Cache\Persister\Collection;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\Cache\Exception\CannotUpdateReadOnlyCollection;
use Doctrine\ORM\PersistentCollection;
class ReadOnlyCachedCollectionPersister extends NonStrictReadWriteCachedCollectionPersister
{
/**
* {@inheritdoc}
*/
public function update(PersistentCollection $collection)
{
if ($collection->isDirty() && $collection->getSnapshot()) {
throw CannotUpdateReadOnlyCollection::fromEntityAndField(
ClassUtils::getClass($collection->getOwner()),
$this->association['fieldName']
);
}
parent::update($collection);
}
}