1
私はZF2
とDoctrine2
とGedmoの教義拡張を使用しています。Zend Framework2用のシャロー可能なDoctrineの動作
マイslugフィールドコードは次のとおりです。
私module.config.php
で
/**
* @Gedmo\Slug
* @ORM\Column(length=128, unique=true)
*/
protected $slug;
私は、次の追加しました:
`'doctrine' => array(
'driver' => array(
'backend_entity' => array(
'class' =>'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'paths' => array(__DIR__ . '/../src/Backend/Entity')
),
'orm_default' => array(
'drivers' => array(
'Backend\Entity' => 'backend_entity',
)
)
),
'eventmanager' => array(
'orm_default' => array(
'subscribers' => array(
'Gedmo\Tree\TreeListener',
'Gedmo\Timestampable\TimestampableListener',
'Gedmo\Sluggable\SluggableListener',
'Gedmo\Loggable\LoggableListener',
'Gedmo\Sortable\SortableListener'
)
)
),
'authentication' => array(
'orm_default' => array(
'object_manager' => 'Doctrine\ORM\EntityManager',
'identity_class' => 'Backend\Entity\User',
'identity_property' => 'email',
'credential_property' => 'password',
'credential_callable' => function(Backend\Entity\User $user, $passwordGiven) {
if ($user->getPassword() == md5($passwordGiven."salt")){
return true;
} else {
return false;
}
},
),
),
),`
は、私は新しいエンティティを作成していたとき、私が持っているエラー 'スラグがnullにすることはできません' 、それゆえ、差し替え可能な動作はうまくいかないようです。
なぜそれが起こりますか?