<?php
/**
* Copyright (C) 2021 Rhyme Digital, LLC.
*
* @link https://rhyme.digital
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
namespace Rhyme\WMassArtsHub\Hooks\LoadFormField;
use Contao\Frontend;
use Rhyme\WMassArtsHub\Helper\ProfileHelper;
/**
* Class LoadProfiles
* @package Rhyme\WMassArtsHub\Hooks\LoadFormField
*/
class LoadProfiles extends Frontend
{
/**
* Load category field options
* @param $objWidget
* @param $formId
* @param $arrData
* @param $objForm
* @return object
*/
public static function run($objWidget, $formId, $arrData, $objForm)
{
if (($objWidget->name == 'profiles' || $objWidget->name == 'profiles[]') &&
in_array($arrData['formID'],
array('eventSubmission',
'fundingSubmission',
'spaceSubmission',
'profdevSubmission',
'venueSubmission',
'callsforartSubmission',))) {
ProfileHelper::addOptionsToWidget($objWidget);
}
return $objWidget;
}
}