Retrieve "fetch as service" flag for instance that is
currently being initialized

You may use this method in initializers.

@return string|NULL
508796
public function getCreationInstanceFetchAsService()
    {
        return  sizeof($this->instanceAsService)
                ? $this->instanceAsService[sizeof($this->instanceAsService)-1]
                : null;
    }
1373812
public function getService() {
        $service = $this->get('service', $this->get('s', 'App.Site.Index'));

        if (count(explode('.', $service)) == 2) {
            $service = 'App.' . $service;
        }

        return $service;
    }
1088117
function getService(serviceName) {

		var serviceData = services[serviceName];

		if (serviceData) {

			if (!serviceData.instance) {
				// check for circular dependencies
				if (isServiceBeingInstantiated(serviceName)) {
					error(new ReferenceError('Circular service dependency: ' + serviceStack.join(' -> ') + ' -> ' + serviceName));
					return null;
				}

				// flag that this service is being initialized just in case there's a circular dependency issue
				serviceStack.push(serviceName);

				serviceData.instance = serviceData.creator(application);

				// no error was thrown for circular dependencies, so we're done
				serviceStack.pop();
			}

			return serviceData.instance;
		} else {
			error(new Error('Service "' + serviceName + '" not found'));
		}

		return null;
	}
472384
protected function _fetch() {
		if (!$this->_resource instanceof PDOStatement) {
			$this->close();
			return false;
		}
		try {
			if ($result = $this->_resource->fetch(PDO::FETCH_NUM)) {
				return [$this->_iterator++, $result];
			}
		} catch (PDOException $e) {
			$this->close();
			return false;
		}
		return null;
	}
1149349
public function getService($service = null)
    {
        if ( $service and ! array_key_exists($service, $this->service) )
        {
            $this->setService($service);
        }

        $this->setToken();

        return $this->service[$service];
    }
978770
public function fetch()
    {
        $sessionToken = null;
        if (AVUser::getCurrentUser())
        {
            $sessionToken = AVUser::getCurrentUser()->getSessionToken();
        }
        $response = AVClient::_request('GET', '/classes/' . $this->className . '/' . $this->objectId, $sessionToken);
        $this->_mergeAfterFetch($response);
    }
1088734
private function getProxy()
    {
        if (isset($this->proxy) && isset($this->proxyPort)) {
            return $this->proxy.":".$this->proxyPort;
        }
        return null;
    }
118391
public function getSearchService()
    {
        if ($this->searchService !== null) {
            return $this->searchService;
        }

        $this->searchService = new SearchService(
            $this,
            $this->searchHandler,
            $this->getDomainMapper(),
            $this->getPermissionCriterionResolver(),
            $this->backgroundIndexer,
            $this->serviceSettings['search']
        );

        return $this->searchService;
    }
416347
public function getServiceLocator()
	{
		if (is_null($this->_serviceLocator))
			$this->_serviceLocator = new ServiceManager(new Config()); //ServiceLocatorFactory::getInstance();
		return $this->_serviceLocator;
	}
53315
function statusObject()
    {
        if ( $this->Status === null )
        {
            $this->Status = eZOrderStatus::fetchByStatus( $this->StatusID );
        }
        return $this->Status;
    }
748708
protected function fetchObject()
	{
		if (!empty($this->cursor) && $this->cursor instanceof \PDOStatement)
		{
			return $this->cursor->fetchObject($this->class);
		}
		else
		{
			return false;
		}
	}
1322130
protected function fetch() {
		if($this->fetched)
			return;
		if($this->container['session']->has('messages'))
			$this->messages = $this->container['session']['messages'];
		$this->fetched = true;
		return $this;
	}
1311566
public function getStatus()
    {
        $this->initialize();
        if ( ! ($this->riakClient instanceof RiakClient)) {
            return null;
        }

        return $this->riakClient->status;
    }
874920
public function getServiceDescription()
    {
        if ($this->serviceDescription === null) {
            $this->serviceDescription = new Description($this->init);
        }
        return $this->serviceDescription;
    }
1028694
protected function getServiceList()
    {
        $name = $this->poolConfig->getName();
        if ($this->poolConfig->isUseProvider() && App::hasBean('providerSelector')) {
            $type = $this->poolConfig->getProvider();

            return provider()->select($type)->getServiceList($name);
        }

        $uri = $this->poolConfig->getUri();
        if (empty($uri)) {
            $error = sprintf('Service does not configure uri name=%s', $name);
            App::error($error);
            throw new \InvalidArgumentException($error);
        }

        return $uri;
    }
233812
public function client()
	{
		if (isset($this->client)) {
			return $this->client ? $this->client : null;
		}
		
		$client_id = $this->clientId();
		if (!$client_id) {
			$this->client = false;
			return null;
		}
		
		$client = $this->fetchClient($client_id);
		if ($client) {
			$this->client = $client;
		}
		else {
			$this->client = false;
		}
		
		return $this->client ? $this->client : null;
	}
615035
public static function getContainer()
    {
        if (!self::$container) {
            self::$container = new ServiceContainer();
            self::provideServices();
        }
        return self::$container;
    }