@param null $serviceName

@return bool
178088
public function disconnect( $serviceName = null ) {
        $service = $this->getService( $serviceName );
        $service->disconnect();

        return ! $service->isConnected();
    }
232867
public function load($serviceName = null)
    {
        if (null === $serviceName) {
            $this->serviceProvider->loadAllServices();
        } else {
            $this->serviceProvider->loadService($serviceName);
        }

        // allow chaining
        return $this;
    }
1373345
public function isFileService($serviceName, $resources = null)
    {
        $service = Service::whereName($serviceName)->first();
        if (!empty($service)) {
            if (null === $type = ServiceManager::getServiceType($service->type)) {
                return false;
            }

            return (ServiceTypeGroups::FILE === $type->getGroup());
        } elseif (!empty($resources)) {
            if (is_string($resources)) {
                $resources = explode(',', $resources);
            }
            foreach ($resources as $resource) {
                if (is_string($resource)) {
                    if (false !== $this->zip->locateName(
                            $serviceName .
                            '/' .
                            rtrim($resource, '/') .
                            '/' .
                            md5($resource) .
                            '.' .
                            static::FILE_EXTENSION
                        )
                    ) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
1221418
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        return $this->getContainer($serviceLocator)->has($requestedName);
    }
1030399
public function getServiceClass(string $serviceName, bool $forced = true): ?string {
        if(!isset($this->serviceClassNames[$serviceName])) {
            if($this->serviceExists($serviceName)) {
                /** @var ContainerInterface $container */
                $container = $this->serviceData[$serviceName];
                if($container->isInstanceLoaded()) {
                    $this->serviceClassNames[$serviceName] = get_class( $container->getInstance() );
                    goto finish;
                }

                if($container instanceof ServiceAwareContainerInterface) {
                    $this->serviceClassNames[$serviceName] = $container->getServiceClass();
                    goto finish;
                } elseif($container instanceof ConfiguredServiceContainer) {
                    $cfg = $container->getConfiguration();
                    // In case of a direct instance fonciguration, get this classname
                    if($cn = $cfg[AbstractFileConfiguration::SERVICE_CLASS] ?? NULL) {
                        $this->serviceClassNames[$serviceName] = $cn;
                        goto finish;

                    } elseif($cn = $cfg[AbstractFileConfiguration::CONFIG_SERVICE_TYPE_KEY] ?? NULL) {
                        // If the developer defined the class by configuration in case of container or file initialisation, use this.
                        $this->serviceClassNames[$serviceName] = $cn;
                        goto finish;
                    }
                }

                // If nothing worked before, finally load the instance
                if($forced)
                    $this->serviceClassNames[$serviceName] = get_class( $container->getInstance() );
            } else {
                // Mark as not existing
                $this->serviceClassNames[$serviceName] = false;
            }
        }

        finish:

        return $this->serviceClassNames[$serviceName] ?: NULL;
    }
398414
final protected function api($serviceName = null)
    {
        if ($serviceName !== null) {
            return $this->api->service($serviceName);
        }

        return $this->api;
    }
727137
public function setService($serviceName)
    {
        if (!array_key_exists($serviceName, $this->servicesList)) {
            $serviceName = $this->defaultServiceName;
        }

        $this->service = new $this->servicesList[$serviceName];

        return $this;
    }
223090
protected function serviceNameExists($name)
    {
        if($this->files->exists($this->getServiceDirectory() . $this->getDirOption() . $name . '.php')) {
            return true;
        }

        return false;
    }
745487
public function hasListeners($eventName = null) {

	    if($eventName) {
            return !empty($this->registry[$eventName]);
        }

        foreach($this->registry as $eventName => $listeners) {
            if(!empty($listeners)) {
                return true;
            }
        }

        return false;

    }
1047756
public function hasService(string $serviceKey): bool
    {
        try {
            $this->getService($serviceKey);
        } catch (MissingServiceException $e) {
            return false;
        }
        return true;
    }
110882
public function get( $serviceName ) {

		if ( !$this->containerBuilder->isRegistered( $serviceName ) ) {
			throw new ServiceNotFoundException( "$serviceName is an unknown service." );
		}

		$parameters = func_get_args();
		array_unshift( $parameters, $serviceName );

		return call_user_func_array( array( $this->containerBuilder, 'create' ), $parameters );
	}
557109
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (array_key_exists($requestedName, $this->prototype)) {
            return false !== $this->prototype[$requestedName];
        }

        $appServiceLocator = $serviceLocator;
        if ($serviceLocator instanceof AbstractPluginManager) {
            $appServiceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var OrmEntityLocatorInterface $ormEntityLocator */
        $ormEntityLocator = $appServiceLocator->get(OrmEntityLocatorInterface::class);

        $hasOrmEntity = $ormEntityLocator->has($requestedName);
        if (false === $hasOrmEntity) {
            $this->prototype[$requestedName] = false;
        }

        return $hasOrmEntity;
    }
685759
function newService($serviceName = null)
    {
        ($serviceName) ?: $serviceName = $this->currentService;
        if ($serviceName === null)
            throw new \Exception('Service name is empty; use ::withService() method.');


        if (false === $service = $this->_resolveTo($serviceName))
            throw new \Exception(sprintf('Cant Resolve To Plugin Service (%s).', $serviceName));

        if ( is_string($service) && class_exists($service) ) {
            // Resolved Class Name
            $options = \Poirot\Std\cast($this->optsData())->toArray();
            $service = \Poirot\Ioc\newInitIns(new instance($service, $options), $this->sc);

        }

        return $service;
    }
1022512
public function setServiceName($serviceName)
    {
        $allowedValues = $this->getServiceNameAllowableValues();
        if (!in_array($serviceName, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'serviceName', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['serviceName'] = $serviceName;

        return $this;
    }
536939
protected function passes($fieldname = null) {
		
		$helper = new StringToArray();
		return true === Request :: isPost() && null === $helper -> execute($fieldname, null, Message :: getErrors(true));
	}
1122970
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        if (substr($name, -5) != 'table') {
            return false;
        }

        if (empty($this->config)) {
            $config = $serviceLocator->get('config');
            $this->config = isset($config['tables']) ? $config['tables'] : [];
        }

        if (!isset($this->config[$requestedName])) {
            return false;
        }

        return true;
    }
802432
public function getConnection($serviceName)
    {
        if (empty($this->connectionPool[$serviceName])) {
            $this->initConnection($serviceName);
        }

        return $this->connectionPool[$serviceName];
    }