简体   繁体   中英

Symfony 3 doctrine error of namespace with AbstractCollectionPersiste

I get this error when inserting with doctrine on my server:

Attempted to load interface "CollectionPersister" from namespace "Doctrine\\ORM\\Persisters\\Collection". Did you forget a "use" statement for another namespace?

The folder: vendor\\doctrine\\orm\\lib\\Doctrine\\ORM\\Persisters\\Collection

AbstractCollectionPersister:

namespace Doctrine\ORM\Persisters\Collection;

use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\UnitOfWork;

/**
 * Base class for all collection persisters.
 *
 * @since 2.0
 * @author Roman Borschel <roman@code-factory.org>
 */
abstract class AbstractCollectionPersister implements CollectionPersister

CollectionPersister:

namespace Doctrine\ORM\Persisters\Collection;

use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\PersistentCollection;

/**
 * Collection persister interface
 * Define the behavior that should be implemented by all collection persisters.
 *
 * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
 * @since 2.5
 */
interface CollectionPersister

Composer:

"require": {
    "php": ">=5.5.9",
    "symfony/symfony": "3.0.*",
    "doctrine/orm": "^2.5",
    "doctrine/doctrine-bundle": "^1.6",
    "doctrine/doctrine-cache-bundle": "^1.2",

It's working on local but not on the server. I've tried to add the use but it doesn't recognise it, as expected.

On local, changed the composer.json:

"doctrine/doctrine-bundle": "^1.5",

Run composer update, and copy the doctrine vendor to the server = problem solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM