Initializes scaffolding

@throws Crud\Exception\NotConfiguredException
960164
protected function initializeScaffolding()
    {
        if (!$this->isConfigured()) {
            throw new Crud\Exception\NotConfiguredException();
        }

        $this->scaffolding->setModelName($this->modelName);
        $this->scaffolding->setFormName($this->formName);
    }
888574
protected function makeInstance(Scaffold $scaffold)
    {

        $scaffold->instance = mp\instantiate(
            $scaffold->class,
            $scaffold->constructor_arguments
        );
    }
70816
public function init()
    {
        if ($this->pagination === null) {
            throw new InvalidConfigException('The "pagination" property must be set.');
        }

        if ($this->widgetId === null) {
            throw new InvalidConfigException('The "widgetId" property must be set.');
        }

        // Publish assets and register main plugin code
        InfiniteScrollAsset::register($this->view);

        // Register configured behavior, if any
        $behavior = ArrayHelper::getValue($this->pluginOptions, 'behavior', null);
        if (!is_null($behavior)) {
            switch ($behavior) {
                case self::BEHAVIOR_TWITTER:
                    $behaviorAsset = 'manual-trigger.js';
                    break;
                case self::BEHAVIOR_LOCAL:
                    $behaviorAsset = 'local.js';
                    break;
                case self::BEHAVIOR_MASONRY:
                    $behaviorAsset = 'masonry-isotope.js';
                    break;
                case self::BEHAVIOR_CUFON:
                    $behaviorAsset = 'cufon.js';
                    break;
                default:
                    $behaviorAsset = false;
            }
            if ($behaviorAsset) {
                $assetManager = $this->view->getAssetManager();
                $assetBundle = $assetManager->getBundle(InfiniteScrollAsset::className());
                $behaviorUrl = $assetManager->getAssetUrl($assetBundle, 'behaviors/' . $behaviorAsset);
                $this->view->registerJsFile($behaviorUrl, [
                    'depends' => [InfiniteScrollAsset::className()]
                ]);
            }
        }

        $widgetSelector = '#' . $this->widgetId;

        // Set default plugin selectors / options if not configured
        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'maxPage', null)))
            $this->pluginOptions['maxPage'] = $this->pagination->getPageCount();

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'contentSelector', null)))
            $this->pluginOptions['contentSelector'] = $widgetSelector . ' .' . $this->itemsCssClass;

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'itemSelector', null)))
            $this->pluginOptions['itemSelector'] = $this->pluginOptions['contentSelector'] . ' >';

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'navSelector', null)))
            $this->pluginOptions['navSelector'] = $widgetSelector . " ul." . $this->options['class'];

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'nextSelector', null)))
            $this->pluginOptions['nextSelector'] = $this->pluginOptions['navSelector'] . ' li.' . $this->nextPageCssClass . " a:first";

        if (is_null(ArrayHelper::getValue($this->pluginOptions, 'loading', null)))
            $this->pluginOptions['loading'] = [];
        if (is_null(ArrayHelper::getValue($this->pluginOptions['loading'], 'img', null))) {
            $assetManager = $this->view->getAssetManager();     // Publish loader img
            list ($imgPath, $imgUrl) = $assetManager->publish('@vendor/nirvana-msu/yii2-infinite-scroll/assets/images/ajax-loader.gif');
            $this->pluginOptions['loading']['img'] = $imgUrl;
        }
    }
1133992
public static function initialize()
    {
        if (static::$isConfigurationLoaded === true) {
            return;
        }
        
        foreach (static::$handlers as $handler) {
            EventManager::getInstance()->addEventHandler($handler[0], $handler[1], $handler[2], $handler[3]);
        }

        static::$isConfigurationLoaded = true;
    }
65872
public function init()
    {
        $this->conf = $this->getConfiguration();
        if (!isset($this->conf)) {
            throw new Exception("Adapter configuration not set, cannot initialize");
        }
        $this->adapters = array();
        foreach ($this->conf['adapters'] as $key => $adapter) {
            $adapterConf = ArrayHelper::merge($this->conf['common'], $adapter);

            $adapterConf['paymentHandler'] = $this;
            $adapterConf['adapterTag'] = $key;
            $this->adapters[$key] = \Yii::createObject($adapterConf);
        }
    }
798676
public static function setup(): void
    {
        $aComponents          = Components::available();
        self::$aContainers    = [];
        self::$aLoadedHelpers = [];
        $aDiscoveredServices  = [
            'nails/common' => self::findServicesForComponent('nails/common'),
        ];

        foreach ($aComponents as $oComponent) {
            $aDiscoveredServices[$oComponent->slug] = self::findServicesForComponent($oComponent->slug);
        }

        $aDiscoveredServices['app'] = self::findServicesForApp();
        $aDiscoveredServices        = array_filter($aDiscoveredServices);

        foreach ($aDiscoveredServices as $sComponentName => $aComponentServices) {

            //  Properties
            if (!empty($aComponentServices['properties'])) {
                if (empty(self::$aContainers[$sComponentName]['properties'])) {
                    self::$aContainers[$sComponentName]['properties'] = new Container();
                }
                foreach ($aComponentServices['properties'] as $sKey => $mValue) {
                    self::$aContainers[$sComponentName]['properties'][$sKey] = $mValue;
                }
            }

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

            /**
             * SERVICES
             * All services are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['services'])) {
                if (empty(self::$aContainers[$sComponentName]['services'])) {
                    self::$aContainers[$sComponentName]['services'] = new Container();
                }
                foreach ($aComponentServices['services'] as $sKey => $cCallable) {
                    self::$aContainers[$sComponentName]['services'][$sKey] = function () use ($sKey, $cCallable) {
                        return $cCallable;
                    };;
                }
            }

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

            /**
             * MODELS
             * All models are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['models'])) {
                if (empty(self::$aContainers[$sComponentName]['models'])) {
                    self::$aContainers[$sComponentName]['models'] = new Container();
                }
                foreach ($aComponentServices['models'] as $sKey => $cCallable) {
                    self::$aContainers[$sComponentName]['models'][$sKey] = function () use ($cCallable) {
                        return $cCallable;
                    };
                }
            }

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

            /**
             * FACTORIES
             * All factories are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['factories'])) {
                if (empty(self::$aContainers[$sComponentName]['factories'])) {
                    self::$aContainers[$sComponentName]['factories'] = new Container();
                }
                foreach ($aComponentServices['factories'] as $sKey => $cCallable) {

                    $cWrapper = function () use ($cCallable) {
                        return $cCallable;
                    };

                    self::$aContainers[$sComponentName]['factories'][$sKey] = self::$aContainers[$sComponentName]['factories']
                        ->factory($cWrapper);
                }
            }

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

            /**
             * FACTORIES
             * All factories are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['resources'])) {
                if (empty(self::$aContainers[$sComponentName]['resources'])) {
                    self::$aContainers[$sComponentName]['resources'] = new Container();
                }
                foreach ($aComponentServices['resources'] as $sKey => $cCallable) {

                    $cWrapper = function () use ($cCallable) {
                        return $cCallable;
                    };

                    self::$aContainers[$sComponentName]['resources'][$sKey] = self::$aContainers[$sComponentName]['resources']
                        ->factory($cWrapper);
                }
            }
        }
    }
449243
protected function init()
    {
        if (empty($this->data['databaseRow']['config'])) {
            $rows = [[['colspan' => 1, 'rowspan' => 1, 'spanned' => 0, 'name' => '0x0']]];
            $colCount = 1;
            $rowCount = 1;
        } else {
            /** @var LayoutSetup $layoutSetup */
            $layoutSetup = GeneralUtility::makeInstance(LayoutSetup::class)->init(0);
            if ($this->data['tableName'] === 'tx-gridelements_backend_layout') {
                $layoutId = $this->data['databaseRow']['alias'] ?: (int)$this->data['databaseRow']['uid'];
                $layout = $layoutSetup->getLayoutSetup($layoutId);
            } else {
                $parser = GeneralUtility::makeInstance(TypoScriptParser::class);
                $parser->parse($this->data['databaseRow']['config']);
                $layout = ['config' => $parser->setup['backend_layout.']];
                if (!empty($layout['config']['rows.'])) {
                    $columns = $layoutSetup->checkAvailableColumns($layout);
                    if ($columns['allowed'] || $columns['disallowed'] || $columns['maxitems']) {
                        $layout['columns'] = $columns;
                        unset($layout['columns']['allowed']);
                        $layout['allowed'] = $columns['allowed'] ?: [];
                        $layout['disallowed'] = $columns['disallowed'] ?: [];
                        $layout['maxitems'] = $columns['maxitems'] ?: [];
                    }
                }
            }
            $rows = [];
            $colCount = $layout['config']['colCount'];
            $rowCount = $layout['config']['rowCount'];
            $dataRows = $layout['config']['rows.'];
            $spannedMatrix = [];
            for ($i = 1; $i <= $rowCount; $i++) {
                $cells = [];
                $row = array_shift($dataRows);
                $columns = $row['columns.'];
                for ($j = 1; $j <= $colCount; $j++) {
                    $cellData = [];
                    if (!$spannedMatrix[$i][$j]) {
                        if (is_array($columns) && !empty($columns)) {
                            $column = array_shift($columns);
                            if (isset($column['colspan'])) {
                                $cellData['colspan'] = (int)$column['colspan'];
                                $columnColSpan = (int)$column['colspan'];
                                if (isset($column['rowspan'])) {
                                    $columnRowSpan = (int)$column['rowspan'];
                                    for ($spanRow = 0; $spanRow < $columnRowSpan; $spanRow++) {
                                        for ($spanColumn = 0; $spanColumn < $columnColSpan; $spanColumn++) {
                                            $spannedMatrix[$i + $spanRow][$j + $spanColumn] = 1;
                                        }
                                    }
                                } else {
                                    for ($spanColumn = 0; $spanColumn < $columnColSpan; $spanColumn++) {
                                        $spannedMatrix[$i][$j + $spanColumn] = 1;
                                    }
                                }
                            } else {
                                $cellData['colspan'] = 1;
                                if (isset($column['rowspan'])) {
                                    $columnRowSpan = (int)$column['rowspan'];
                                    for ($spanRow = 0; $spanRow < $columnRowSpan; $spanRow++) {
                                        $spannedMatrix[$i + $spanRow][$j] = 1;
                                    }
                                }
                            }
                            if (isset($column['rowspan'])) {
                                $cellData['rowspan'] = (int)$column['rowspan'];
                            } else {
                                $cellData['rowspan'] = 1;
                            }
                            if (isset($column['name'])) {
                                $cellData['name'] = $column['name'];
                            }
                            if (isset($column['colPos'])) {
                                $colPos = (int)$column['colPos'];
                                $cellData['column'] = $colPos;
                                $cellData['allowed'] = [];
                                if (isset($layout['allowed'][$colPos])) {
                                    foreach ($layout['allowed'][$colPos] as $key => $valueArray) {
                                        $cellData['allowed'][$key] = implode(',', array_keys($valueArray));
                                    }
                                }
                                $cellData['disallowed'] = [];
                                if (isset($layout['disallowed'][$colPos])) {
                                    foreach ($layout['disallowed'][$colPos] as $key => $valueArray) {
                                        $cellData['disallowed'][$key] = implode(',', array_keys($valueArray));
                                    }
                                }
                                $cellData['maxitems'] = (int)$layout['maxitems'][$colPos];
                            }
                        }
                    } else {
                        $cellData = ['colspan' => 1, 'rowspan' => 1, 'spanned' => 1];
                    }
                    $cells[] = $cellData;
                }
                $rows[] = $cells;
                if (!empty($spannedMatrix[$i]) && is_array($spannedMatrix[$i])) {
                    ksort($spannedMatrix[$i]);
                }
            }
        }
        $this->rows = $rows;
        $this->colCount = (int)$colCount;
        $this->rowCount = (int)$rowCount;
    }
708023
protected function configure()
    {
        $this->value('builder', $this->builder);
        $this->value('frameworkBuilder', $this->builder->frameworkBuilder());
        $this->value('components', $this->builder->components());
    }
1101501
public function configure()
    {
        if (!$this->getSchemaKey()) {
            throw new BadMethodCallException(sprintf(
                'Attempted to run configure() on a %s instance without a schema key set. See setSchemaKey(),
                or specify one in the constructor.',
                __CLASS__
            ));
        }

        $schemas = $this->config()->get('schemas');
        $config = isset($schemas[$this->getSchemaKey()]) ? $schemas[$this->getSchemaKey()] : [];

        return $this->applyConfig($config);
    }
297995
public function initialize()
    {
        parent::initialize();

        if ($this->getModelConfiguration()->isRestorableModel()) {
            $this->setApply(function (Builder $q) {
                return $q->withTrashed();
            });
        }

        $this->setHtmlAttribute('class', 'table table-striped');
    }
1261651
public function init()
    {
        $this->fillFromConfig([
            'columns',
            'model',
            'recordUrl',
            'recordOnClick',
            'noRecordsMessage',
            'showPageNumbers',
            'recordsPerPage',
            'showSorting',
            'defaultSort',
            'showCheckboxes',
            'showSetup',
            'showTree',
            'treeExpanded',
            'showPagination',
            'customViewPath',
        ]);

        /*
         * Configure the list widget
         */
        $this->recordsPerPage = $this->getSession('per_page', $this->recordsPerPage);

        if ($this->showPagination == 'auto') {
            $this->showPagination = $this->recordsPerPage && $this->recordsPerPage > 0;
        }

        if ($this->customViewPath) {
            $this->addViewPath($this->customViewPath);
        }

        $this->validateModel();
        $this->validateTree();
    }
264718
protected function configure(): void
    {

        $this->register('makeType');
        $this->register('makeValue');
        $this->register('makeArgument');
        $this->register('makeStrong');
        $this->register('makeExceptionHeader');
        $this->register('makeExceptionBody');
        $this->register('makeExceptionTrace');
        $this->register('makeEmpty');
    }
934602
public function init()
    {
        Craft::setAlias('@NerdsAndCompany/Schematic', __DIR__);

        $config = [
            'components' => [
                'elementIndexMapper' => [
                    'class' => ElementIndexMapper::class,
                ],
                'emailSettingsMapper' => [
                    'class' => EmailSettingsMapper::class,
                ],
                'generalSettingsMapper' => [
                    'class' => GeneralSettingsMapper::class,
                ],
                'modelMapper' => [
                    'class' => ModelMapper::class,
                ],
                'pluginMapper' => [
                    'class' => PluginMapper::class,
                ],
                'userSettingsMapper' => [
                    'class' => UserSettingsMapper::class,
                ],
            ],
            'dataTypes' => [
                'plugins' => PluginDataType::class,
                'sites' => SiteDataType::class,
                'volumes' => VolumeDataType::class,
                'assetTransforms' => AssetTransformDataType::class,
                'emailSettings' => EmailSettingsDataType::class,
                'fields' => FieldDataType::class,
                'generalSettings' => GeneralSettingsDataType::class,
                'sections' => SectionDataType::class,
                'globalSets' => GlobalSetDataType::class,
                'categoryGroups' => CategoryGroupDataType::class,
                'tagGroups' => TagGroupDataType::class,
                'userGroups' => UserGroupDataType::class,
                'userSettings' => UserSettingsDataType::class,
                'elementIndexSettings' => ElementIndexDataType::class,
            ],
        ];

        Craft::configure($this, $config);

        parent::init();
    }
440806
protected function init() {
        $this->data['crud'] = 'd';
        $this->data['edulevel'] = self::LEVEL_OTHER;
        $this->data['objecttable'] = plan::TABLE;
    }
71539
protected function init() {
        $this->data['crud'] = 'r';
        $this->data['edulevel'] = self::LEVEL_OTHER;
        if (strstr($this->component, 'mod_') === false) {
            throw new \coding_exception('The event name or namespace is invalid.');
        } else {
            $this->modname = str_replace('mod_', '', $this->component);
        }
    }
679775
private function start()
    {
        $name = $this->scaffoldCommandObj->getObjName('Name');
        $observer_name = $name . 'Observer';
        $this->makeObserver($observer_name, 'observer');

        $this->registerObserver($name, $observer_name);
    }
556362
public function init()
	{
		//assert proper model is set
		if ($this->subject === null || !ComponentConfig::isActiveRecord($this->subject, false)) {
			$msg = Yii::t('app', 'Setting the model property of type ActiveRecord is mandatory');
			throw new InvalidConfigException($msg);
		}
		ComponentConfig::hasBehavior($this->subject, CommentsBehavior::className(), true);

		//load the comments
		$this->loadComments();

		//prepare options
		Html::addCssClass($this->options, 'widget-comments');
		Html::addCssClass($this->commentOptions, 'comment');
	}