public function addIndexMetadata($contextName, IndexMetadata $indexMetadata)
    {
        if (isset($this->indexMetadatas[$contextName])) {
            throw new \InvalidArgumentException(sprintf(
                'Context name "%s" has already been registered',
                $contextName
            ));
        }

        $indexMetadata->setName($this->name);
        $indexMetadata->setClassMetadata($this);
        $this->indexMetadatas[$contextName] = $indexMetadata;
    }
public function addIndexMetadata($contextName, IndexMetadata $indexMetadata)
    {
        if (isset($this->indexMetadatas[$contextName])) {
            throw new \InvalidArgumentException(sprintf(
                'Context name "%s" has already been registered',
                $contextName
            ));
        }

        $indexMetadata->setName($this->name);
        $indexMetadata->setClassMetadata($this);
        $this->indexMetadatas[$contextName] = $indexMetadata;
    }
public function addIndexMetadata ( $ contextName , IndexMetadata $ indexMetadata ) { if ( isset ( $ this -> indexMetadatas [ $ contextName ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Context name "%s" has already been registered' , $ contextName ) ) ; } $ indexMetadata -> setName ( $ this -> name ) ; $ indexMetadata -> setClassMetadata ( $ this ) ; $ this -> indexMetadatas [ $ contextName ] = $ indexMetadata ; }
Add an index metadata for the given context name.

@param mixed $contextName
@param IndexMetadata $indexMetadata
Add an index metadata for the given context name .