doctrine / mongodb-odm-softdelete-bundle
此包已被废弃且不再维护。未建议替代包。
Symfony2 Doctrine MongoDB SoftDelete Bundle
dev-master
2012-05-09 02:01 UTC
Requires
This package is not auto-updated.
Last update: 2021-03-13 11:00:01 UTC
README
此包实现了Doctrine MongoDB ODM和Symfony2的软删除功能。
安装 (仅限Symfony 2.0.x)
1. 在您的 deps
文件中添加以下内容
[doctrine-odm-softdelete] git=git://github.com/doctrine/mongodb-odm-softdelete.git [DoctrineMongoDBSoftDeleteBundle] git=git://github.com/doctrine/mongodb-odm-softdelete-bundle.git target=bundles/Doctrine/Bundle/MongoDBSoftDeleteBundle
2. 运行供应商安装脚本
php bin/vendors install
3. 将 Doctrine\\ODM\\MongoDB\\SoftDelete
命名空间添加到 app/autoload.php
<?php // ... $loader->registerNamespaces(array( // ... 'Doctrine\\ODM\\MongoDB\\SoftDelete' => __DIR__ . '/../vendor/doctrine-odm-softdelete/lib',
4. 在 app/appKernel.php
中配置包的加载
<?php // ... $bundles = array( // ... new Doctrine\Bundle\MongoDBSoftDeleteBundle\DoctrineMongoDBSoftDeleteBundle(),
配置
要开始,请在 config.yml
中添加以下内容
doctrine_mongodb_softdelete: deleted_field_name: deletedAt