Returns a logger instance.

@param string $id - Logger ID.

@return LoggerInterface
777921
public function getLogger(string $id)
    {
        if (!isset($this->_loggers[$id])) {
            throw new \RuntimeException('Logger with ID "'.$id.'" is not registered on the logger factory.');
        }

        return $this->_loggers[$id];
    }
939476
public function get($id) {
		if (isset($this->_helpers[$id])) {
			return $this->_helpers[$id];
		}
		
		$helper = $this->loadHelper($id);
		
		if ($helper instanceof LocatorAwareInterface && ! $helper->hasLocator() && $this->hasLocator()) {
			$helper->setLocator($this->getLocator());
		}
		
		if ($helper instanceof HelpersBrokerAwareInterface && ! $helper->hasHelpersBroker()) {
			$helper->setHelpersBroker($this);
		}
		
		$this->_helpers[$id] = $helper;
		
		return $helper;
	}
440522
public static function instance($id = 'datatable')
    {
        $cls = get_called_class();
        if (!isset(self::$instance[$id])) {
            self::$instance[$id] = new $cls($id);
        }

        return self::$instance[$id];
    }
405555
protected function getUserByRecaller($id)
	{
		$this->viaRemember = ! is_null($user = $this->provider->retrieveByID($id));

		return $user;
	}
469541
public function get($id)
    {
        if (!is_string($id)) {
            throw new ContainerException('$id must be a string');
        }

        if (!isset($this->definitions[$id])) {
            throw new NotFoundException("Unresolvable ".$id);
        }

        return $this->definitions[$id];
    }
972663
public function findUserById($id)
    {
        if ($id instanceof UserInterface) {
            return $id;
        }

        $result =   $this->userProvider->findById($id);
        if ($result) {
            return $result;
        }

        $exceptionMessage   =   "A user with the ID '%(id)s' cannot be found.";

        throw new UserNotFound(isprintf($exceptionMessage, compact('id')));
    }
818053
public static function get($id){
		$class_name = get_called_class();
		if( !isset(self::$instances[$class_name]) ){
			self::$instances[$class_name] = [];
		}
		if( !isset(self::$instances[$class_name][$id]) ){
			self::$instances[$class_name][$id] = new $class_name($id);
		}
		return self::$instances[$class_name][$id];
	}
1006838
public function getAlarmById(int $id): AlarmInterface
    {
        $alarms = $this->getAlarms();
        foreach ($alarms as $alarm) {
            if ($alarm->getId() === $id) {
                return $alarm;
            }
        }

        throw new NotFoundException("Unable to find an alarm with the id {$id} on this network");
    }
1096627
private function createLogger(): LoggerInterface
    {
        $container = ContainerScope::getContainer();
        if (empty($container) || !$container->has(LogsInterface::class)) {
            return new NullLogger();
        }

        //We are using class name as log channel (name) by default
        return $container->get(LogsInterface::class)->getLogger(static::class);
    }
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;
    }
270852
public function get($id)
    {
        if (! $this->has($id)) {
            throw new NotFoundException(
                sprintf('Identifier %s is not defined in container', $id)
            );
        }

        $entry = $this->container[$id]->instance();

        if (is_callable($entry)) {
            return $entry($this);
        }

        return $entry;
    }
591608
public function loginById($id)
    {
        /** @var User $user */
        $user = wei()->user()->findById($id);
        if (!$user) {
            return ['code' => -1, 'message' => '用户不存在'];
        } else {
            return $this->loginByRecord($user);
        }
    }
1220692
private function resolveInstance(string $id)
    {
        if (Validator::key($id)->validate($this->instances)) {
            return $this->instances[$id];
        }
        return $this->resolveAutomaticResolvable($id);
    }
78406
public function getModule($id)
    {
        $returnValue = null;

    	$className = $this->getId().'_actions_'.$id;
		if(class_exists($className)) {
			$returnValue = new $className;
		} else {
			common_Logger::e('could not load '.$className);
		}

        return $returnValue;
    }
454477
public function getFormatter(string $id)
    {
        if (!isset($this->_formatters[$id])) {
            throw new \RuntimeException('Formatter with ID "'.$id.'" is not registered on the logger factory.');
        }

        return $this->_formatters[$id];
    }
804971
public function get($id) {
		// if there's no parent and we don't have one, it's not found
		if($this->parent === null && !array_key_exists($id, $this->instances)) {
			// try to make it
			try {
				return $this->instantiate($id);
			} catch(\Exception $e) {
				// throw RefNotFound if we couldn't build one
				throw new RefNotFound($id);
			}
		}

		// return either ours or our parent's
		return array_key_exists($id, $this->instances) ? $this->instances[$id] : $this->parent->get($id);
	}
1107000
public function getById($id)
    {
        if ($this->id == $id) return $this;

        return $this->children->getById($id);
    }