. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace Espo\Tools\EntityManager\Hook\Hooks; use Espo\Core\DataManager; use Espo\Core\Exceptions\Error; use Espo\Tools\EntityManager\Hook\UpdateHook; use Espo\Tools\EntityManager\Params; /** * @noinspection PhpUnused */ class StreamUpdateHook implements UpdateHook { private const PARAM = 'stream'; public function __construct( private DataManager $dataManager, ) {} /** * @throws Error */ public function process(Params $params, Params $previousParams): void { if ($params->get(self::PARAM) && !$previousParams->get(self::PARAM)) { $this->dataManager->rebuild([$params->getName()]); } } }