doubei8541 2018-01-22 13:59
浏览 23
已采纳

Typo3自己的页面存储库没有使用正确的数据库表(页面)

We like to create a model and repository for querying the typo3 pages table.

Therefore we create a model (Dealer) and a repository (DealerRepository). We added the mapping to the pages table with TS setup

config.tx_extbase.persistence.classes.Tobias\CarApi\Domain\Model\Dealer.mapping.tableName = pages

The setting is loaded. I can see it in the TS Browser.

Unfortunately a findAll() respond with a error, that the table (auto-generated) doesn't exists:

Internal Server Error: Table 'typo3.tx_carapi_domain_model_dealer' doesn't exist

In the db table cf_extbase_datamapfactory_datamap is also the wrong table. When I change the entry tableName there to pages it works perfectly.

I did everything like many sources describes and cleared the caches and db entries, so does have anyone an idea what we are missing?

Typo3: 8.7.9

  • 写回答

1条回答 默认 最新

  • dongse3348 2018-01-22 14:18
    关注

    I always add such essential TypoScript settings to a file ext_typoscript_setup.txt in my extension and insert the settings there:

    config.tx_extbase.persistence.classes {
        Tobias\CarApi\Domain\Model\Dealer {
            mapping {
                tableName = pages
            }
        }
    }
    # for backend and cli API
    module.tx_carapi {
        persistence.classes {
            Tobias\CarApi\Domain\Model\Dealer < config.tx_extbase.persistence.classes.Tobias\CarApi\Domain\Model\Dealer
        }
    }
    

    This will always be loaded in any circumstances.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?