Add internal and external links from other service
@param Service $service
168031
public function addLinksFrom(Service $service) {
	    $links = $service->getLinks();
	    foreach($links as $name => $link) {
	        if (is_numeric($name)) {
                $this->addLink($link);
            } else {
                $this->addLink($link, $name);
            }
        }

        $externalLinks = $service->getExternalLinks();
	    foreach($externalLinks as $name => $link) {
	        if (is_numeric($name)) {
                $this->addExternalLink($link);
            } else {
                $this->addExternalLink($link, $name);
            }
        }

	}
959662
protected function setService($serviceName)
    {
        if (empty($serviceName)) {
            throw new InternalServerErrorException('No target service name provided for CSV import.');
        }
        $this->service = ServiceManager::getService($serviceName);
        $this->serviceGroupType = $this->service->getServiceTypeInfo()->getGroup();
    }
1198491
public void addDefaultValues(Service service) {
		for (ServiceOperation op : (List<ServiceOperation>) service.getOperations()) {
			addDefaultValues(op);
		}
	}
513937
private function setNonShopAwareCommands(Command $service)
    {
        if (!$service instanceof AbstractShopAwareCommand && $service instanceof Command) {
            $this->commands[] = $service;
        }
    }
1052778
def attach_service(cls, service):
        
        invalid_service = True
        _service_classes = {'_tcp_service': TCPService, '_http_service': HTTPService}
        for key, value in _service_classes.items():
            if isinstance(service, value):
                cls._services[key] = service
                invalid_service = False
                break
        if invalid_service:
            cls._logger.error('Invalid argument attached as service')
        cls._set_bus(service)
1183026
public function setServiceDatum($service, $key, $value)
    {
        $this->servicesData[$service][$key] = $value;

        return $this;
    }
1111746
def addInternalLink(self, link):
        '''
        
        '''
        if isinstance(link, InternalLink):
            self.internalLinks.append(link)
        else:
            raise InternalLinkError( 
                'link Type should be InternalLink, not %s' % type(link))
1068619
public function delete_service($serviceid) {
        global $DB;
        $DB->delete_records('external_services_users', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_services_functions', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_tokens', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_services', array('id' => $serviceid));
    }
366584
public function setService($name, $service)
    {
        $this->services[$name] = $service;
        $this->serviceConfiguration[$name]['persistent'] = true;
        return $this;
    }
1189024
public function attachServices($obj) {
		$args = get_class_vars( get_class($obj) );
		foreach ($args as $_k=>$_v) {
			if (substr($_k, -7) == 'Service') {
				$obj->$_k = _makePromise($_k);
			}
		}
	}
668158
public function add( $serviceName, $service, $expectedReturnType = null ) {

		if ( !is_callable( $service ) ) {
			$service = function() use( $service ) {
				return $service;
			};
		}

		$this->containerBuilder->registerCallback( $serviceName, $service );

		if ( $expectedReturnType !== null ) {
			$this->containerBuilder->registerExpectedReturnType( $serviceName, $expectedReturnType );
		}
	}
1216573
private function addServices()
    {
        if (!$this->container->getDefinitions()) {
            return '';
        }

        $code = "services:\n";
        foreach ($this->container->getDefinitions() as $id => $definition) {
            $code .= $this->addService($id, $definition);
        }

        $aliases = $this->container->getAliases();
        foreach ($aliases as $alias => $id) {
            while (isset($aliases[(string) $id])) {
                $id = $aliases[(string) $id];
            }
            $code .= $this->addServiceAlias($alias, $id);
        }

        return $code;
    }
226342
public function addServiceDetailsDocuments(\AgentSIB\Diadoc\Api\Proto\Events\ServiceDetailsAttachment $value)
    {
        if ($this->ServiceDetailsDocuments === null) {
            $this->ServiceDetailsDocuments = new \Protobuf\MessageCollection();
        }

        $this->ServiceDetailsDocuments->add($value);
    }
514774
protected function setDependencies(ServiceContainer $container)
    {
        parent::setDependencies($container);

        if (isset($container['attachments/config'])) {
            $this->setConfig($container['attachments/config']);
        } elseif (isset($container['config']['attachments'])) {
            $this->setConfig($container['config']['attachments']);
        }
    }
1337499
public function propagate($service)
    {
        if(is_object($service) &&  ($service instanceof ServiceLocatorAwareInterface)){
            $service->setServiceLocator($this);
        }
        return $service;
    }
949701
public function add($id, $service, $replace = false)
    {
        if ($this->has($id) == true && $replace == false) {           
            throw new ServiceExistsException($id);
        }
        $this->services[$id] = $service;
    }
631887
public function setService($key, $service)
    {
        $this->set($key, $service);
        unset($this->instanceCache[$key]);
        return $this;
    }