Instantiates specified service.

@param string $id
195643
protected function instantiate($id)
    {
        $this->instances[$id] = call_user_func($this->callbacks[$id], $this);
    }
313905
protected function serviceFromDefinition($id, $args)
    {
        // create the service object
        $service = $this->createServiceObject($id, $args);

        // run predefined methods if any
        $this->runDefinedMethods($id, $service);

        // decorate the service if DecorateExtension loaded
        $this->decorateService($service);

        return $service;
    }
106482
public static function factory($id)
    {
        $id = (string)$id;
        if (!isset(static::$permissions[$id])) {
            static::$permissions[$id] = new static($id);
        }
        return static::$permissions[$id];
    }
346892
protected function initReflection($id) {
		$normalizedId = ucfirst($id);

		$classname  = $this->dirForEachService ? $normalizedId : '';
		$classname .= $this->classPrefix . $normalizedId . $this->classPostfix;

		foreach ($this->namespaces as $namespace) {
			$class = $namespace . '\\' . $classname;

			try {
				return new ReflectionClass($class);
			} catch (ReflectionException $e) {}
		}
	}
223944
public function initialize($id, $alias = null)
    {
        $this->id    = $id;
        $this->alias = $alias;
    }
108846
public function load($id)
    {
        $procedure = $this->procedureFactory->createProcedure();
        $procedure->setTemplate(
            $this->loadTemplate($id)
        );

        return $procedure;
    }
1127626
private function load($id = null)
    {

        $this->initialize();
        $this->id = $id;

        return $this->getDataConnector()->loadResourceLink($this);

    }
674985
public function get($id)
    {
        if(!isset($this->loadedServices[$id]))
            $this->loadedServices[$id] = parent::get($id);

        return $this->loadedServices[$id];
    }
125105
public static function load($id)
    {
        $packet = Redis::instance()->hgetall(self::redisKey($id));

        if (empty($packet) or empty($packet['queue']) or !count($payload = json_decode($packet['payload'], true))) {
            return null;
        }

        return new static($packet['queue'], $payload['id'], $payload['class'], $payload['data']);
    }
1254904
private function initializeEntity($id, $created)
    {
        $this->id = $id ?: $this->generateEntityID();
        $this->created = $created ?: $this->generateCreatedTime();
    }
947584
public function load($id)
    {
        if (!$this->controller) {
            throw $this->exception('Unable to load model, setSource() must be set');
        }

        if ($this->loaded()) {
            $this->unload();
        }
        $this->hook('beforeLoad', array('load', array($id)));

        $this->controller->loadById($this, $id);

        $this->endLoad();

        return $this;
    }
1225946
public function populate($id)
    {
        if (empty($id)) {
            throw new EmptyRegistrationIdException();
        }

        $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl() . '/' . urlencode($id));
    }
494809
public function offsetUnset($id)
    {
        // Unset the alias, service or factory
        if (isset($this->aliases[$id])) {
            // Call set alias so that it is internally resolved
            $this->setAlias($id, null);
        }
        if (isset($this->services[$id])) {
            unset($this->services[$id]);
        }
        if (isset($this->factories[$id])) {
            unset($this->factories[$id]);
        }
    }
949701
public function add($id, $service, $replace = false)
    {
        if ($this->has($id) == true && $replace == false) {           
            throw new ServiceExistsException($id);
        }
        $this->services[$id] = $service;
    }
1083644
public function select($id = null)
    {
        if (!is_array($id) || !isset($id['service']) || !isset($id['method']) || empty($id['service']) || empty($id['method'])) {
            throw new \InvalidArgumentException('Invalid id argument. Must be array and containing at least service and method property.');
        }

        $serviceName = $id['service'];
        if (!isset($this->services[$serviceName])) {
            throw new \InvalidArgumentException("Service '$serviceName' is not registered in StorageProvider.");
        }

        $method = $id['method'];
        if (!empty($this->services[$serviceName]['methods']) && !in_array($method, $this->services[$serviceName]['methods'])) {
            throw new \InvalidArgumentException("Method '$method' is not registered in StorageProvider for service '$serviceName'.");
        }

        $service = $this->container->get($serviceName);
        $callable_with_arguments = array($service, $method, isset($id['arguments']) ? $id['arguments'] : null);

        return new StorageSelection($callable_with_arguments);
    }
1357871
public function initDefinition($id) {
		$reflection = $this->getReflectionById($id);
		$args       = $this->getArguments();
		
		$definition = new Definition\ClassDefinition($reflection, $args);
		
		if ($this->isFactory()) {
			$definition->setFactoryMode();
		}
		
		return $definition;
	}
345320
public function & SetId ($id) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		$this->id = $id;
		self::$instances[$id] = & $this;
		return $this;
	}