设置doctrine 1.2.x可搜索行为索引表名称?

时间:2011-12-02 17:46:27

标签: php zend-framework doctrine searchable-plugin

我正在使用Zend Framework和doctrine 1.2.x. 有没有办法在添加Doctrine Searchable Behavior时定义索引表名? ./doctrine build-all-reload脚本生成奇怪的“model__info_index”表名而不是“info_index”

这是我的配置: //shema.yml

Info:
  actAs:
    Searchable:
      fields: [name, body]
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(256)
    body: clob

//的application.ini

doctrine.data_fixtures_path = APPLICATION_PATH  "/configs/data/fixtures"
doctrine.sql_path = APPLICATION_PATH  "/configs/data/sql"
doctrine.migrations_path = APPLICATION_PATH  "/configs/data/migrations"
doctrine.yaml_schema_path = APPLICATION_PATH  "/configs/schema.yml"
doctrine.models_path = APPLICATION_PATH  "/models/Model/"
doctrine.generate_models_options.pearStyle = true
doctrine.generate_models_options.generateTableClasses = false
doctrine.generate_models_options.generateBaseClasses = true
doctrine.generate_models_options.baseClassPrefix = "Base_"
doctrine.generate_models_options.baseClassesDirectory = null
doctrine.generate_models_options.classPrefixFiles = false
doctrine.generate_models_options.classPrefix = "Model_"
doctrine.model_autoloading = 2

1 个答案:

答案 0 :(得分:1)

我也想设置索引表名称,但在文档中找不到任何内容。但是,Versionable行为具有选项className,该选项还设置表名称;事实证明这也适用于Searchable行为:

Info:
  actAs:
    Searchable:
      fields: [name, body]
      className: InfoIndex
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(256)
    body: clob