Retrieve description for all services matched by IDs in
array $services

@param array $services
@return array

@ValuService\Context({"cli", "http", "http-get"})
333340
public function describeMany(array $services)
    {
        $descriptions = [];
        foreach ($services as $serviceId) {
            $descriptions[] = $this->describe($serviceId);
        }
        
        return $descriptions;
    }
192783
public function findByIds(array $ids): array
    {
        $spec = $this->createSpecification()->where(['id' => $ids]);

        return $this->findAll($spec);
    }
619646
public function getServiceDescription()
	{
		return array(
			$this->_name . '.init' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.finish' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.deleteItems' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.saveItems' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "items","optional" => false ),
				),
				"returns" => "array",
			),
			$this->_name . '.searchItems' => array(
				"parameters" => array(
					array( "type" => "string","name" => "site","optional" => false ),
					array( "type" => "array","name" => "condition","optional" => true ),
					array( "type" => "integer","name" => "start","optional" => true ),
					array( "type" => "integer","name" => "limit","optional" => true ),
					array( "type" => "string","name" => "sort","optional" => true ),
					array( "type" => "string","name" => "dir","optional" => true ),
				),
				"returns" => "array",
			),
		);
	}
981170
private function loadServiceDescription(array $service, array $description)
    {
        foreach ($service as $section => $set) {
            if ($section == 'operations') {
                // add global parameters to the operation parameters
                foreach ($set as &$op)
                    $op['parameters'] = isset($op['parameters'])
                                    ? $op['parameters'] + $this->globalParams
                                    : $this->globalParams;
            }
            $description[$section] = $description[$section] + $set;
        }
        return $description;
    }
238331
public static function getAPI($service)
    {
        $service = strtolower($service);
        $identifier = 'com:connect.oauth.service.'.$service;
        if (!AnService::has($identifier)) {
            $config = array();
            $config['consumer'] = self::getConsumer($service);
            $config['enabled'] = self::enabled($service);
            AnService::set($identifier, AnService::get($identifier, $config));
        }

        return    AnService::get($identifier);
    }
1199824
function withScoped(array $services) {
        foreach ($services as $method => $type) {
            $this->bind($method, $type, self::SCOPED);
        }
        return $this;
    }
186996
protected function getServiceUrls($service)
    {
        if (!$this->_config) {
            $httpClient = new HttpClient();
            $httpClient->transport = CurlTransport::class;
            $requests = [];
            foreach ($this->discoverUrls as $discoverUrl) {
                $requests[] = $httpClient->get($discoverUrl);
            }
            $responses = $httpClient->batchSend($requests);

            $list = [];
            foreach ($responses as $response) {
                foreach ($response->data as $name => $url) {
                    $list[$name][] = $url;
                }
            }

            $this->_config = $list;
        }

        if (isset($this->_config[$service]) && $this->_config[$service]) {
            return $this->_config[$service];
        } else {
            throw new ErrorException('不存在该服务，请检查服务中心');
        }
    }
231926
public function getUrl(array $services)
    {
        $chunks = array();

        foreach ($services as $serviceName => $details) {
            foreach ($details['dependencies'] as $dependency) {
                $chunks[] = '[' . $serviceName . ']->[' . $dependency . ']';
            }
        }

        return implode(',', $chunks);
    }
596738
private function getCachedSoapActions( $service ) {
        $cache       = $this->client->cache;
        $soapActions = $cache->get( $service . '_soap_actions' );

        return $soapActions;
    }
1181658
public function get($fields = [])
    {
        $fields = empty($fields) ? $this->fields : $fields;

        $this->haveFields($fields);

        $query = $this->createQuery($fields);

        return new ServiceCollection($this->getService(), $this->service->query($query)->getEntries());
    }
1099927
public function select(string $service): array
    {
        $services = $this->discover->services($service);

        return $services[array_rand($services)];
    }
588969
protected function get($service, array &$options)
    {
        if (isset($options[$service]) && is_object($options[$service])) {
            return $options[$service];
        }

        $service = explode('_', $service);
        $service = array_map('ucfirst', $service);
        $service = 'get' . implode('', $service);

        return $options[$service] = $this->$service($options);
    }
517645
public function listCommand($services = [], $table_pattern = '')
    {
        foreach ($services ?: $this->_getDbServices() as $service) {
            /** @var \ManaPHP\DbInterface $db */
            $db = $this->_di->getShared($service);

            $this->console->writeLn(['service: `:service`', 'service' => $service], Console::FC_CYAN);
            foreach ($this->_getTables($service, $table_pattern) as $row => $table) {
                $columns = (array)$db->getMetadata($table)[Db::METADATA_ATTRIBUTES];
                $primaryKey = $db->getMetadata($table)[Db::METADATA_PRIMARY_KEY];
                foreach ($columns as $i => $column) {
                    if (in_array($column, $primaryKey, true)) {
                        $columns[$i] = $this->console->colorize($column, Console::FC_RED);
                    }
                }

                $this->console->writeLn([' :row :table(:columns)',
                    'row' => sprintf('%2d ', $row + 1),
                    'table' => $this->console->colorize($table, Console::FC_GREEN),
                    'columns' => implode(', ', $columns)]);
            }
        }
    }
832352
public function get($service)
    {
        // Is the service active?
        if (isset($this->active[$service])) {
            if ($this->loaded[$service]['singleton']) {
                return $this->active[$service];
            } else {
                return $this->load($service);
            }
        } elseif (isset($this->loaded[$service])) {
            // Is the service loaded?
            return $this->load($service);
        }

        $message  = "CDI the service accessed '$service' is not loaded in the DI-container.";
        $services = $this->getServices();
        natcasesort($services);
        $services = implode("\n", $services);
        $message .= " Loaded services are: <pre>$services</pre>";
        
        throw new \Exception($message);
    }
628333
public function getId($service): ?string
    {
        if ($this->serviceContainer === $service) {
            return 'service_container';
        }

        if (null === $id = ($this->getServiceId)($service)) {
            return null;
        }

        if ($this->serviceContainer->has($id) || $this->reversibleLocator->has($id)) {
            return $id;
        }

        return null;
    }
339670
public function several(array $ids)
    {
        $result = [];
        foreach ($ids as $id) {
            if ($this->has($id)) {
                $result[$id] = $this->get($id);
            }
        }
        return $result;

    }
402053
public function findById(array $ids)
    {
        $ids = $this->idsToMongo($ids);

        $documents = array();
        $remaining = array();
        foreach ($ids as $id) {
            if ($this->identityMap->has($id)) {
                $documents[(string) $id] = $this->identityMap->get($id);
            } else {
                $remaining[] = $id;
            }
        }

        if (count($documents) == count($ids)) {
            return $documents;
        }

        return array_merge(
            $documents,
            $this->createQuery(array('_id' => array('$in' => $remaining)))->all()
        );
    }