<?php

declare(strict_types=1);

/*
 * Chill is a software for social workers
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Chill\MainBundle\Export\Helper;

use Chill\MainBundle\Export\Exception\ExportRuntimeException;
use Chill\MainBundle\Export\ExportManager;

trait ExportManagerAwareTrait
{
    private ?ExportManager $exportManager;

    public function setExportManager(ExportManager $exportManager): void
    {
        $this->exportManager = $exportManager;
    }

    public function getExportManager(): ExportManager
    {
        if (null === $this->exportManager) {
            throw new ExportRuntimeException('ExportManager not set');
        }

        return $this->exportManager;
    }
}
