我尝试使用从StofDoctrineExtenstion
的时间戳行为为我的对象,但它不起作用。对象已成功保存,但createdAt
属性未保存。Symfony 2 StofDoctrineExtensionBundle时间戳与odm(MongoDB)
这是我的配置:
#Doctrine ODM Configuration
doctrine_mongodb:
connections:
default:
server: mongodb://localhost:27017
options:
connect: true
default_database: rent
document_managers:
default:
auto_mapping: true
#stof doctrine extension
stof_doctrine_extensions:
mongodb:
default:
timestampable: true
和类(我用我的主要目标timestampable行为也试过)
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @MongoDB\MappedSuperclass
*/
abstract class BaseApartment
{
/**
* @Gedmo\Timestampable(on="create")
* @MongoDB\Date
*/
private $createdAt;
}
Symfony的2.0.12,我deps
文件:
[StofDoctrineExtensionsBundle]
git=git://github.com/stof/StofDoctrineExtensionsBundle.git
target=/bundles/Stof/DoctrineExtensionsBundle
version=v1.0 (also tried version 1.1)
[gedmo-doctrine-extensions]
git=git://github.com/l3pp4rd/DoctrineExtensions.git
target=gedmo-doctrine-extensions
怎么了?有任何想法吗?
什么都发生在此?我有同样的问题atm。 – Alexander 2012-07-12 23:56:53