public function addMetaData(string $serviceName, string $key, array $values)
    {
        // make sure the service exists
        if (!$this->has($serviceName)) {
            throw new UnknownServiceException('There is no service named "' . $serviceName . '" specified.'); 
        }

        // make sure the metadata key is allocated
        if (!isset($this->metadata[$key])) {
            $this->metadata[$key] = [];
        }

        // make sure the service key is allocated
        if (!isset($this->metadata[$key][$serviceName])) {
            $this->metadata[$key][$serviceName] = [];
        }

        // append
        $this->metadata[$key][$serviceName][] = $values;
        $this->linkMetaService($serviceName, $key);
    }
public function addMetaData(string $serviceName, string $key, array $values)
    {
        // make sure the service exists
        if (!$this->has($serviceName)) {
            throw new UnknownServiceException('There is no service named "' . $serviceName . '" specified.'); 
        }

        // make sure the metadata key is allocated
        if (!isset($this->metadata[$key])) {
            $this->metadata[$key] = [];
        }

        // make sure the service key is allocated
        if (!isset($this->metadata[$key][$serviceName])) {
            $this->metadata[$key][$serviceName] = [];
        }

        // append
        $this->metadata[$key][$serviceName][] = $values;
        $this->linkMetaService($serviceName, $key);
    }
public function addMetaData ( string $ serviceName , string $ key , array $ values ) { // make sure the service exists if ( ! $ this -> has ( $ serviceName ) ) { throw new UnknownServiceException ( 'There is no service named "' . $ serviceName . '" specified.' ) ; } // make sure the metadata key is allocated if ( ! isset ( $ this -> metadata [ $ key ] ) ) { $ this -> metadata [ $ key ] = [ ] ; } // make sure the service key is allocated if ( ! isset ( $ this -> metadata [ $ key ] [ $ serviceName ] ) ) { $ this -> metadata [ $ key ] [ $ serviceName ] = [ ] ; } // append $ this -> metadata [ $ key ] [ $ serviceName ] [ ] = $ values ; $ this -> linkMetaService ( $ serviceName , $ key ) ; }
Same as `setMetaData` but will append the data instead of overriding.

@param string            $serviceName
@param string            $key
@param array             $values

@return void
Same as setMetaData but will append the data instead of overriding .