Create a new Fluent instance while appending default config.

@param  int  $id

@return \Illuminate\Support\Fluent
552241
protected function toFluent($id)
    {
        $defaults = Arr::get($this->config, 'defaults', []);
        return new Fluent(array_merge($defaults, [
                    'id'     => $id,
                    'childs' => []
        ]));
    }
1117373
protected function registerConfig(string $id): Config
    {
        $definition = $this->definitions[$id] ?? [];
        $config = new Config($definition);

        return apply_filters(static::HOOK, $config, $definition, $id);
    }
611513
public function setResultCacheId($id)
    {
        $this->_queryCacheProfile = $this->_queryCacheProfile
            ? $this->_queryCacheProfile->setCacheKey($id)
            : new QueryCacheProfile(0, $id, $this->_em->getConfiguration()->getResultCacheImpl());

        return $this;
    }
1112388
public function edit($id)
    {
        $this->builder->setMode(Builder::MODE_EDIT);
        $this->builder->setResourceId($id);

        $this->setFieldValue($id);

        return $this;
    }
25850
public function edit($id = null)
    {
        $application = $this->applications->getApplication($id);
        $settings = $this->applications->getSettingsForApplication($application);

        if ($settings !== null) {
            $settingsByCategory = $settings->transform(function ($item) {
                if (! $item->category) {
                    $item->category = 'Settings';
                }

                return $item;
            })->groupBy('category');

            // Move 'Settings' category to the start
            if (isset($settingsByCategory['Settings'])) {
                $defaultCategory = $settingsByCategory->pull('Settings');

                $settingsByCategory->prepend($defaultCategory, 'Settings');
            }
        }

        return soda_cms_view('data.settings.view', compact('application', 'settingsByCategory'));
    }
349067
public static function factory ($id)
    {
        // Which class to instantiate
        $entityClassName = get_called_class();

        // Get object cache registry
        $ObjectRegistry  = \Teon\ObjectRegistry\ObjectRegistry::getInstance();

        // If this object already in cache, use that
        if ($ObjectRegistry->exists($entityClassName, $id)) {
            return $ObjectRegistry->get($entityClassName, $id);
        }

        // If not, instantiate new, store in object registry and return it
        $Object = new $entityClassName($id);
        $ObjectRegistry->store($Object);
        return $Object;
    }
436661
protected function getFacetConfig($id)
    {
        $config = null;

        foreach ($this->settings['facets'] as $facet) {
            if (array_key_exists('id', $facet)) {
                if ($facet['id'] === $id) {
                    $config = $facet;
                    break;
                }
            }
        }

        return $config;
    }
151533
public function setResultCacheId($id)
    {
        $this->queryCacheProfile = $this->queryCacheProfile
            ? $this->queryCacheProfile->setCacheKey($id)
            : new QueryCacheProfile(0, $id, $this->em->getConfiguration()->getResultCacheImpl());

        return $this;
    }
36171
public function setId($id)
    {
        if (($content = $this->getContent()) instanceof FormInterface) {
            $content->setId($id);
        }

        return $this;
    }
663774
public function add(string $id): self
    {
        if (!isset($this->data[$id])) {
            $registeredAddon = \BearFramework\Addons::get($id);
            if ($registeredAddon === null) {
                throw new \Exception('The addon ' . $id . ' is not registered!');
            }
            $registeredAddonOptions = $registeredAddon->options;
            if (isset($registeredAddonOptions['require']) && is_array($registeredAddonOptions['require'])) {
                foreach ($registeredAddonOptions['require'] as $requiredAddonID) {
                    if (is_string($requiredAddonID) && !isset($this->data[$requiredAddonID])) {
                        $this->add($requiredAddonID);
                    }
                }
            }

            $dir = $registeredAddon->dir;
            $this->data[$id] = new \BearFramework\App\Addon($id, $dir);
            $this->app->contexts->add($dir);
        }
        return $this;
    }
1287857
public function setId($id)
    {
        if (!is_null($id)) {
            $id = (string) $id;
        }

        $this->id = $id;
        return $this;
    }
1066609
public static function getInstance($id = '0')
    {
        self::$id = $id;
        if (isset(self::$instances[self::$id])) {
            return self::$instances[self::$id];
        }

        return self::$instances[self::$id] = new self;
    }
590004
public function configureAction($id)
    {
        /** @var \Thelia\Handler\Exporthandler $exportHandler */
        $exportHandler = $this->container->get('thelia.export.handler');

        $export = $exportHandler->getExport($id);
        if ($export === null) {
            return $this->pageNotFound();
        }

        // Render standard view or ajax one
        $templateName = 'export-page';
        if ($this->getRequest()->isXmlHttpRequest()) {
            $templateName = 'ajax/export-modal';
        }

        return $this->render(
            $templateName,
            [
                'exportId' => $id,
                'hasImages' => $export->hasImages(),
                'hasDocuments' => $export->hasDocuments(),
                'useRange' => $export->useRangeDate()
            ]
        );
    }
1315292
public static function custom($id, $input)
    {
        return (new static($id))->setInput($input instanceof BasicFormElement ? $input : new $input($id));
    }
630907
protected function addChild(string $id, string $parent): ?Fluent
    {
        $node = $this->descendants($this->items, $parent);

        // it might be possible parent is not defined due to ACL, in this
        // case we should simply ignore this request as child should
        // inherit parent ACL access.
        if (! isset($node)) {
            return null;
        }

        $item = $node->get('childs');
        $item[$id] = $this->toFluent($id);

        $node->childs($item);

        return $item[$id];
    }
919473
public static function factory($id)
    {
        $id = (string)$id;
        if (!isset(static::$resources[$id])) {
            static::$resources[$id] = new static($id);
        }
        return static::$resources[$id];
    }
1009636
public function config($id = false) {
        $boxes = $this->_getAllBrowseboxes();
        if (count($boxes)) {
            $script = "Garp.browseboxes = [];\n";
            foreach ($boxes as $boxId => $box) {
                $jsConfig  = $this->_getJavascriptOptions($box);
                $boxScript = '';
                $boxScript .= "new Garp.Browsebox({\n";
                $boxScript .= "\t\"id\": \"$boxId\",\n";
                $i = 0;
                $total = count($jsConfig);
                foreach ($jsConfig as $confKey => $confVal) {
                    $boxScript .= "\t\"$confKey\": \"$confVal\"";
                    if ($i < ($total-1)) {
                        $boxScript .= ',';
                    }
                    $boxScript .= "\n";
                    $i++;
                }
                $boxScript .= "})";

                if ($id && $boxId === $id) {
                    return $this->_wrapInTags($boxScript);
                }
                $script .= "Garp.browseboxes.push($boxScript);\n";
            }
            return $this->_wrapInTags($script);
        }
        return '';
    }