我尝试StofDoctrineExtenstion
对我的对象使用可时间戳的行为,但它不起作用。对象保存成功,但createdAt
属性未保存。
这是我的配置:
#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
和类(我也尝试对我的主要对象使用时间戳行为)
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
怎么了?有任何想法吗?