【问题标题】:How to get all Data Objects related to Asset in Pimcore?如何在 Pimcore 中获取与资产相关的所有数据对象?
【发布时间】:2023-02-10 00:57:34
【问题描述】:

我需要获取与资产相关的所有数据对象。 我在 Asset API 文档中找不到它:https://pimcore.com/docs/pimcore/current/Development_Documentation/Assets/Working_with_PHP_API.html

如何做最有效?

【问题讨论】:

    标签: php pimcore


    【解决方案1】:

    您可以在资产的“需要”选项卡上的 Pimcore 管理面板中查看和调试它的使用方式:

    $dependencies = $asset->getDependencies()->getRequiredBy();
    foreach ($dependencies as $dependency) {
        if ($dependency['type'] !== 'object') {
            continue;
        }
        $concreteDataObject = Concrete::getById($dependency['id']);
    }
    

    【讨论】:

      猜你喜欢
      • 2014-05-08
      • 2018-10-14
      • 1970-01-01
      • 2017-09-28
      • 2019-12-03
      • 1970-01-01
      • 2020-07-15
      • 2019-05-30
      • 1970-01-01
      相关资源
      最近更新 更多