numero2/contao-perview-bundle

将 Perview 的工作广告导入 Contao 作为新闻

安装: 4

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:contao-bundle

1.0.1 2024-04-23 13:23 UTC

This package is auto-updated.

Last update: 2024-09-23 14:37:58 UTC


README

License: LGPL v3

关于

将来自 perview® 的工作广告作为新闻导入 Contao。

系统要求

安装

  • 通过 Contao Manager 或 Composer 安装 (composer require numero2/contao-perview-bundle)
  • 通过 Contao-Installtool 或使用 contao:migrate 命令运行数据库更新。

钩子

默认情况下,该组件仅从 perview® 工作广告中导入某些信息。如果您需要更多元数据,您可以使用 parsePerviewPosition 钩子自行导入。

// src/EventListener/ParsePerviewPositionListener.php
namespace App\EventListener;

use Contao\CoreBundle\ServiceAnnotation\Hook;
use Contao\NewsModel;

/**
 * @Hook("parsePerviewPosition")
 */
class ParsePerviewPositionListener
{
    public function __invoke(NewsModel $news, object $position, bool $isUpdate): void
    {
        $news->something = $position->something;
    }
}