set component definition with id, delay create instance
@param string $id
@param mixed  $definition
@return static
975926
public function set($id, $definition)
	{
	    if (is_numeric($id)) {
	        $id = is_string($definition) ? $definition : $definition['class'];
	    }
	    $this->_definitions[$id] = $definition;
	    return $this;
	}
508790
public function setDatatableId($id)
    {
        if (!array_key_exists($id, self::$instances)) {
            self::$instances[$id] = $this;
        } else {
            throw new \Exception('Identifer already exists');
        }

        return $this;
    }
285447
public static function findOrCreate($id)
    {
        if ($data = static::find($id)) {
            return $data;
        }

        $id = static::getMapper()->normalizeID($id);

        return new static($id);
    }
79673
public function add(DefinitionInterface $definition)
    {
        $index = count($this->_names);
        $this->_definitionSource[$index] = $definition;
        $this->_names[$definition->getName()] = $index;
        return $this;
    }
1302924
protected function waitForElementWithId($id, $timeout = 2000)
    {
        try {
            $this->waitForElement('Id', $id, $timeout);
        } catch (\Exception $e) {
            throw new CannotFindElement("Can't find an element with an ID of "
                .$id.' within the time period of '.$timeout.' miliseconds');
        }

        return $this;
    }
703781
public function set(string $id, Definition $definition, bool $multi = false): self
    {
        if ($this->isFrozen()) {
            throw new FrozenException();
        }

        if ($this->has($id) && $multi !== $this->isMulti($id)) {
            throw new MixedMultiException($id);
        }

        if ($multi) {
            if (!isset($this->definitions[$id])) {
                $this->definitions[$id] = new Definition\Multi();
            }

            /** @var Definition\Multi $multiDefinition */
            $multiDefinition = $this->definitions[$id];
            $multiDefinition->add($definition);
        } else {
            $this->definitions[$id] = $definition;
        }

        return $this;
    }
518959
public function setId(string $id = null): ButtonInterface
    {
        if ($this->isVisibility()) {
            $this->id = $id;
        }

        return $this;
    }
755301
protected function initDefinition($id) {
		$initializer = $this; // Superclosure won't works without this trick
		
		$call = function($args = null) use($initializer, $id) {
			return $initializer->get($id, $args);
		};
		
		$args = $this->getArguments();
		
		$definition = new Definition\CallbackDefinition($call, $args);
		
		if ($this->isFactory()) {
			$definition->setFactoryMode();
		}
		
		return $definition;
	}
971877
private function addService($id, Definition $definition)
    {
        $this->definitionVariables = new \SplObjectStorage();
        $this->referenceVariables = array();
        $this->variableCount = 0;

        $return = array();

        if ($definition->isSynthetic()) {
            $return[] = '@throws RuntimeException always since this service is expected to be injected dynamically';
        } elseif ($class = $definition->getClass()) {
            $class = $this->container->resolveEnvPlaceholders($class);
            $return[] = sprintf('@return %s A %s instance', 0 === strpos($class, '%') ? 'object' : '\\'.ltrim($class, '\\'), ltrim($class, '\\'));
        } elseif ($definition->getFactory()) {
            $factory = $definition->getFactory();
            if (is_string($factory)) {
                $return[] = sprintf('@return object An instance returned by %s()', $factory);
            } elseif (is_array($factory) && (is_string($factory[0]) || $factory[0] instanceof Definition || $factory[0] instanceof Reference)) {
                if (is_string($factory[0]) || $factory[0] instanceof Reference) {
                    $return[] = sprintf('@return object An instance returned by %s::%s()', (string) $factory[0], $factory[1]);
                } elseif ($factory[0] instanceof Definition) {
                    $return[] = sprintf('@return object An instance returned by %s::%s()', $factory[0]->getClass(), $factory[1]);
                }
            }
        }

        if ($definition->isDeprecated()) {
            if ($return && 0 === strpos($return[count($return) - 1], '@return')) {
                $return[] = '';
            }

            $return[] = sprintf('@deprecated %s', $definition->getDeprecationMessage($id));
        }

        $return = str_replace("\n     * \n", "\n     *\n", implode("\n     * ", $return));
        $return = $this->container->resolveEnvPlaceholders($return);

        $doc = '';
        if ($definition->isShared()) {
            $doc .= <<<'EOF'

     *
     * This service is shared.
     * This method always returns the same instance of the service.
EOF;
        }

        if (!$definition->isPublic()) {
            $doc .= <<<'EOF'

     *
     * This service is private.
     * If you want to be able to request this service from the container directly,
     * make it public, otherwise you might end up with broken code.
EOF;
        }

        if ($definition->isAutowired()) {
            $doc = <<<EOF

     *
     * This service is autowired.
EOF;
        }

        if ($definition->isLazy()) {
            $lazyInitialization = '$lazyLoad = true';
            $lazyInitializationDoc = "\n     * @param bool    \$lazyLoad whether to try lazy-loading the service with a proxy\n     *";
        } else {
            $lazyInitialization = '';
            $lazyInitializationDoc = '';
        }

        // with proxies, for 5.3.3 compatibility, the getter must be public to be accessible to the initializer
        $isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition);
        $visibility = $isProxyCandidate ? 'public' : 'protected';
        $methodName = $this->generateMethodName($id);
        $code = <<<EOF

    /*{$this->docStar}
     * Gets the '$id' service.$doc
     *$lazyInitializationDoc
     * $return
     */
    {$visibility} function {$methodName}($lazyInitialization)
    {

EOF;

        $code .= $isProxyCandidate ? $this->getProxyDumper()->getProxyFactoryCode($definition, $id, $methodName) : '';

        if ($definition->isSynthetic()) {
            $code .= sprintf("        throw new RuntimeException('You have requested a synthetic service (\"%s\"). The DIC does not know how to construct this service.');\n    }\n", $id);
        } else {
            if ($definition->isDeprecated()) {
                $code .= sprintf("        @trigger_error(%s, E_USER_DEPRECATED);\n\n", $this->export($definition->getDeprecationMessage($id)));
            }

            $code .=
                $this->addServiceInclude($id, $definition).
                $this->addServiceLocalTempVariables($id, $definition).
                $this->addServiceInlinedDefinitions($id, $definition).
                $this->addServiceInstance($id, $definition).
                $this->addServiceInlinedDefinitionsSetup($id, $definition).
                $this->addServiceProperties($id, $definition).
                $this->addServiceMethodCalls($id, $definition).
                $this->addServiceConfigurator($id, $definition).
                $this->addServiceReturn($id, $definition)
            ;
        }

        $this->definitionVariables = null;
        $this->referenceVariables = null;

        return $code;
    }
724875
public function setComponent($id, $properties)
    {
        if (null === $properties) {
            unset($this->_components[$id]);
        } elseif (isset($this->_components[$id])) {
            $component = $this->_components[$id];
            /* @var Component $component */
            $component->configure($properties);
            $this->_componentConfig[$id] = array_merge($this->_componentConfig[$id], $properties);
        } elseif (isset($this->_componentConfig[$id])) {
            $this->_componentConfig[$id] = array_merge($this->_componentConfig[$id], $properties);
        } else {
            $this->_componentConfig[$id] = $properties;
        }
    }
856785
public function buildDefinition($definition)
    {
        if (is_callable($definition)) {
            return $definition;
        }

        if (is_array($definition) && isset($definition['component'])) {
            return new Listener(
                $definition['component'],
                $definition['method'] ?: null,
                $definition['arguments'] ? (array) $definition['arguments'] : []
            );
        }

        throw new AppException('Invalid listener format, must be callable or array with component key');
    }
680194
public function setId($id) : self
    {
        if (!is_string($id) && !is_int($id)) {
            throw new InvalidArgumentException('Id must be either an int or a string');
        }

        $this->id = $id;

        return $this;
    }
171579
public function setId($id)
    {
        if (!empty($id) && is_string($id) && ctype_print($id)) {
            $this->id = trim($id);
        }

        return $this;
    }
486783
public function set(string $id, $definition, $params = [])
    {
        return $this->register($id, $definition, $params);
    }
1000491
public function setId(int $id): Website
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
97899
public function extend(string $id) : DefinitionInterface
    {
        if ($this->providers->provides($id)) {
            $this->providers->register($id);
        }

        if ($this->definitions->has($id)) {
            return $this->definitions->getDefinition($id);
        }

        throw new NotFoundException(
            sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $id)
        );
    }
1299057
public function setId($id = null)
    {
        $this->id = ($id !== null) ? $id : SecureKey::generate();

        return $this;
    }