@param $oContainer
@param $aData

@throws \Exception
189563
public static function doInstall(&$oContainer, &$aData)
        {

            // init class vars
            self::_init($oContainer, $aData);

            // check provided database credentials
            if (self::_checkDatabaseCredentials()) {

                // write symfony's parameters.yml
                 self::_saveSystemConfig();

                 // insert default database dump
                self::_insertDump();

                // create admin user
                 self::_createAdminUser();

                // insert control-url to settgins-db
                 self::_saveControlUrl();

                // reset the assetic configs
                 self::resetAsseticConfig();

                //create keys
                self::createKeys();

                // clears caches and dumps assets
                self::clearCache();

            } else {
                throw new \Exception(self::$_container->get("translator")->trans("install.bad_database_credentials"));
            }
        }
321747
public function onSubmitCallback(DataContainer $dc)
    {
        // Schedule a news feed update
        if ('tl_news_category' === $dc->table && $dc->id) {
            /** @var Model $modelAdapter */
            $modelAdapter = $this->framework->getAdapter(Model::class);

            $newsIds = $modelAdapter->getReferenceValues('tl_news', 'categories', $dc->id);
            $newsIds = \array_map('intval', \array_unique($newsIds));

            if (\count($newsIds) > 0) {
                $archiveIds = $this->db
                    ->executeQuery('SELECT DISTINCT(pid) FROM tl_news WHERE id IN ('.\implode(',', $newsIds).')')
                    ->fetchAll(\PDO::FETCH_COLUMN, 0);

                $session = $this->session->get('news_feed_updater');
                $session = \array_merge((array) $session, $archiveIds);
                $this->session->set('news_feed_updater', \array_unique($session));
            }
        }
    }
747712
public function checkTitle ($value, DataContainer $dc)
	{
		$db = Database::getInstance();

		$objTitle = $db->prepare("SELECT id FROM tl_elements WHERE NOT id=? AND pid=? AND title=?")
					   ->execute($dc->activeRecord->id, $dc->activeRecord->pid, $value);

		if ($objTitle->numRows > 0)
		{
			throw new Exception(sprintf($GLOBALS['TL_LANG']['ERR']['aliasExists'], $value));
		}
		
		return $value;
	}
1127226
public function setParent(DataContainer $parent = null)
	{
		$this->parent = $parent;

		if ($this->parent)
		{
			$this->enableParent();
		}
		else
		{
			$this->disableParent();
		}

		return $this;
	}
277386
public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
    {
        $bPaymentOk = parent::ExecutePayment($oOrder, $sMessageConsumer);

        $aParams = array();
        // payment preauthorization values
        if (isset($_SESSION['3ds_payment'])) {
            $aParams = $_SESSION['3ds_payment'];
            unset($_SESSION['3ds_payment']);
        }

        // execute preauthorization
        $aResponse = $this->PayOnePreauthorization($aParams, $oOrder);
        if ($aResponse['success']) {
            $bPaymentOk = true;
            // reset payOne session
            if (isset($_SESSION['PayOneResponse'])) {
                unset($_SESSION['PayOneResponse']);
            }
        } else {
            $bPaymentOk = false;
        }

        if (!$bPaymentOk) {
            $oMsgManager = TCMSMessageManager::GetInstance();
            $oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $aResponse['errormessage']));
        }

        return $bPaymentOk;
    }
1017751
public function execute($hydrationMode = self::RESULT_TYPE_NONE)
    {
        if ($hydrationMode !== self::RESULT_TYPE_NONE && $hydrationMode !== self::RESULT_TYPE_SDK &&
            isset($this->parameters['ReturnValues']) && $this->parameters['ReturnValues'] === self::RETURN_VALUES_NONE) {
            throw ODMException::resultTypeRequiresReturnValues();
        }

        return parent::execute($hydrationMode);
    }
1182661
protected function configureContainer(
        LimoncelloContainerInterface $container,
        array $globalConfigurators = null,
        array $routeConfigurators = null
    ): void {
        if (empty($globalConfigurators) === false) {
            foreach ($globalConfigurators as $configurator) {
                assert($this->checkPublicStaticCallable($configurator, [LimoncelloContainerInterface::class]));
                $configurator($container);
            }
        }
        if (empty($routeConfigurators) === false) {
            foreach ($routeConfigurators as $configurator) {
                assert($this->checkPublicStaticCallable($configurator, [LimoncelloContainerInterface::class]));
                $configurator($container);
            }
        }
    }
43938
public function executePostActions(DataContainerInterface $container)
    {
        \header('Content-Type: text/html; charset=' . $GLOBALS['TL_CONFIG']['characterSet']);

        $this->objDc = $container;

        $action = $this->getEnvironment()->getInputProvider()->getValue('action');

        if (\in_array(
            $action,
            [
                // This is impossible to handle generically in DcGeneral.
                'toggleFeatured',
                // DcGeneral handles sub palettes differently.
                'toggleSubpalette'
            ]
        )) {
            return;
        }

        if (\in_array(
            $action,
            [
                // Load nodes of the page structure tree. Compatible between 2.X and 3.X.
                'loadStructure',
                // Load nodes of the file manager tree.
                'loadFileManager',
                // Load nodes of the page tree.
                'loadPagetree',
                // Load nodes of the file tree.
                'loadFiletree',
                // Reload the page/file picker.
                'reloadPagetree',
                'reloadFiletree',
                'setLegendState'
            ]
        )) {
            $this->{$action}();
            return;
        }

        $ajax = new ContaoAjax($action);
        $ajax->executePreActions();
        $ajax->executePostActions(new DcCompat($this->getEnvironment(), $this->getActiveModel()));
    }
911853
public function onLoadCallback(DataContainer $dc)
    {
        if (!$dc->id) {
            return;
        }

        /** @var Input $input */
        $input = $this->framework->getAdapter(Input::class);

        // Handle the edit all modes differently
        if ($input->get('act') === 'editAll' || $input->get('act') === 'overrideAll') {
            $categories = $this->db->fetchColumn('SELECT categories FROM tl_news_archive WHERE limitCategories=1 AND id=?', [$dc->id]);
        } else {
            $categories = $this->db->fetchColumn('SELECT categories FROM tl_news_archive WHERE limitCategories=1 AND id=(SELECT pid FROM tl_news WHERE id=?)', [$dc->id]);
        }

        if (!$categories || 0 === \count($categories = StringUtil::deserialize($categories, true))) {
            return;
        }

        $GLOBALS['TL_DCA'][$dc->table]['fields']['categories']['eval']['rootNodes'] = $categories;
    }
1097976
public function deleteBlob($container = '', $name = '', $noCheck = false)
    {
        $this->checkConnection();
        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);
            if (empty($container)) {
                throw new \Exception("No container named '$container'");
            }

            $obj = null;
            try {
                $obj = $container->DataObject($name);
            } catch (\Exception $ex) {
                if ($noCheck) {
                    return;
                }
                throw $ex;
            }
            if ($obj) {
                $obj->Delete();
            }
        } catch (\Exception $ex) {
            static::handleGuzzleException($ex);
            if ($ex instanceof ObjFetchError) {
                throw new NotFoundException("File '$name' was not found.'");
            }
            throw new DfException('Failed to delete blob "' . $name . '": ' . $ex->getMessage());
        }
    }
1143795
protected function askQuestionExecute($aData)
    {
        $oMailProfile = TdbDataMailProfile::GetProfile('product-info-request');
        $oMailProfile->AddDataArray($aData);
        // now add product info as well
        /** @var $oActiveProduct TdbShopArticle */
        $oActiveProduct = TdbShop::GetActiveItem();
        $aArticleData = $oActiveProduct->GetObjectPropertiesAsArray();
        $oMailProfile->AddDataArray($aArticleData);
        // add link to article

        $sLink = $oActiveProduct->getLink(true, null, array(TdbShopArticle::CMS_LINKABLE_OBJECT_PARAM_CATEGORY => null));
        $oMailProfile->AddData('sLink', $sLink);
        $oMailProfile->ChangeFromAddress($aData['email'], $aData['name']);
        $oMailProfile->SendUsingObjectView('emails', 'Customer');

        $oMsgManager = TCMSMessageManager::GetInstance();
        $oMsgManager->AddMessage($this->sModuleSpotName, 'QUESTION-SEND');

        $this->getRedirect()->redirect($this->getActivePageService()->getActivePage()->GetRealURLPlain());
    }
552565
private function assertExternalReferenceHasKnownContainer(ExternalReference $externalReference): void
    {
        if (!isset($this->containerAccessors[$externalReference->containerIdentifier()])) {
            throw new \DomainException(sprintf(
                'External container with identifier "%s" does not exist.',
                $externalReference->containerIdentifier()
            ));
        }
    }
847883
protected function failIfContainerNotFound(ServiceException $exception, $action, $containerName)
    {
        $errorCode = $this->getErrorCodeFromServiceException($exception);

        if ($errorCode === self::ERROR_CONTAINER_NOT_FOUND) {
            throw new \RuntimeException(sprintf(
                'Failed to %s: container "%s" not found.',
                $action,
                $containerName
            ), $exception->getCode());
        }
    }
751777
public function execute(\Drouter\Container $container)
    {
        $rota = $this->getMatchedRoute();

        $callable = $rota->getCallable();
        $params = $rota->getParams();

        $middlewares = $this->getMiddlewares();
        $routeName = $rota->getName();
        $groupPrefix = $rota->getGroupPrefix();

        //Middlewares de group
        if (!is_null($groupPrefix) && isset($this->groupMiddlewares[$groupPrefix])) {
            $middlewares1 = $this->groupMiddlewares[$groupPrefix];
            $routeMiddlewares = $rota->getMiddlewares();
            $rota->addMiddlewares($this->joinMiddlewares($middlewares1, $routeMiddlewares));
        }

        //Middlewares de routeNames armazenadas em memoria para adição posterior
        if (isset($middlewares[$routeName])) {
            $middlewares1 = $middlewares[$routeName];
            $routeMiddlewares = $rota->getMiddlewares();
            $rota->addMiddlewares($this->joinMiddlewares($middlewares1, $routeMiddlewares));
            unset($this->middlewares[$routeName]);
        }

        //rotas globais acima das indicadas com name
        if (isset($middlewares['*'])) {
            $middlewares1 = $middlewares['*'];
            $routeMiddlewares = $rota->getMiddlewares();
            $rota->addMiddlewares($this->joinMiddlewares($middlewares1, $routeMiddlewares));
        }

        if (count($rota->getMiddlewares())) {
            Middleware::executeMiddlewares($rota->getMiddlewares(), $container);
        }

        if (is_string($callable) && preg_match('/^[a-zA-Z\d\\\\]+[\:][\w\d]+$/', $callable)) {
            $exp = explode(':', $callable);

            $obj = filter_var($exp[0], FILTER_SANITIZE_STRING);
            $obj = new $obj($container);
            $method = filter_var($exp[1], FILTER_SANITIZE_STRING);

            $callable = [$obj, $method];
        }
            

        if (!empty($params)) {
            $params = array_values($params);
        }

        $container->options = $rota->getOptions();

        if (is_object($callable) || (is_string($callable) && is_callable($callable))) {
            $params[] = $container;
        }

        call_user_func_array($callable, $params);
    }
1216805
public function configureException(ContainerBuilder $container, array $config)
    {
        // retrieve available filters
        $filters = [];
        foreach ($config['exception']['filters'] as $name => $filter) {
            $filters[$name] = $filter;
        }

        // retrieve available renderers
        $renderers = [];
        foreach ($config['exception']['renderers'] as $name => $renderer) {
            $renderers[$name] = $renderer;
        }

        // retrieve block customization
        $blockFilters = [];
        $blockRenderers = [];
        foreach ($config['blocks'] as $service => $settings) {
            if (isset($settings['exception'], $settings['exception']['filter'])) {
                $blockFilters[$service] = $settings['exception']['filter'];
            }
            if (isset($settings['exception'], $settings['exception']['renderer'])) {
                $blockRenderers[$service] = $settings['exception']['renderer'];
            }
        }

        $definition = $container->getDefinition('sonata.block.exception.strategy.manager');
        $definition->replaceArgument(1, $filters);
        $definition->replaceArgument(2, $renderers);
        $definition->replaceArgument(3, $blockFilters);
        $definition->replaceArgument(4, $blockRenderers);

        // retrieve default values
        $defaultFilter = $config['exception']['default']['filter'];
        $defaultRenderer = $config['exception']['default']['renderer'];
        $definition->addMethodCall('setDefaultFilter', [$defaultFilter]);
        $definition->addMethodCall('setDefaultRenderer', [$defaultRenderer]);
    }
1326078
protected function createObject($oData, $bReturnObject = false)
    {
        $aData = [
            'bucket_id'        => $oData->bucket->id,
            'filename'         => $oData->filename,
            'filename_display' => $oData->name,
            'mime'             => $oData->mime,
            'filesize'         => $oData->filesize,
            'md5_hash'         => $oData->md5_hash,
            'driver'           => $this->oEnabledDriver->slug,
        ];

        // --------------------------------------------------------------------------

        if (isset($oData->img->width) && isset($oData->img->height) && isset($oData->img->orientation)) {
            $aData['img_width']       = $oData->img->width;
            $aData['img_height']      = $oData->img->height;
            $aData['img_orientation'] = $oData->img->orientation;
        }

        // --------------------------------------------------------------------------

        //  Check whether file is animated gif
        if ($oData->mime == 'image/gif') {
            if (isset($oData->img->is_animated)) {
                $aData['is_animated'] = $oData->img->is_animated;
            } else {
                $aData['is_animated'] = false;
            }
        }

        // --------------------------------------------------------------------------

        $oObjectModel = Factory::model('Object', 'nails/module-cdn');
        $iObjectId    = $oObjectModel->create($aData);

        if ($iObjectId) {
            return $bReturnObject ? $this->getObject($iObjectId) : $iObjectId;
        } else {
            return false;
        }
    }
570119
public function disableFramework(DataContainer $dataContainer): void
    {
        if ($dataContainer->activeRecord->layoutType === 'bootstrap' && $dataContainer->activeRecord->framework) {
            $dataContainer->activeRecord->framework = [];

            $statement = $this->connection->prepare('UPDATE tl_layout SET framework = \'\' WHERE id=?');
            $statement->bindValue(1, $dataContainer->id);
            $statement->execute();
        }
    }