src/Session/Container.php
protected function getEventAdapter(EventArgs $args)
    {
        $class = get_class($args);
        if (preg_match('@Doctrine\\\([^\\\]+)@', $class, $m) && in_array($m[1], ['ODM', 'ORM'])) {
            if (!isset($this->adapters[$m[1]])) {
                $adapterClass = 'Gedmo\\Mapping\\Event\\Adapter\\' . $m[1];
                $this->adapters[$m[1]] = new $adapterClass();
            }

            $this->adapters[$m[1]]->setEventArgs($args);
            return $this->adapters[$m[1]];
        }

        throw new \InvalidArgumentException('Session continaer does not support event arg class: ' . $class);
    }
protected function getEventAdapter(EventArgs $args)
    {
        $class = get_class($args);
        if (preg_match('@Doctrine\\\([^\\\]+)@', $class, $m) && in_array($m[1], ['ODM', 'ORM'])) {
            if (!isset($this->adapters[$m[1]])) {
                $adapterClass = 'Gedmo\\Mapping\\Event\\Adapter\\' . $m[1];
                $this->adapters[$m[1]] = new $adapterClass();
            }

            $this->adapters[$m[1]]->setEventArgs($args);
            return $this->adapters[$m[1]];
        }

        throw new \InvalidArgumentException('Session continaer does not support event arg class: ' . $class);
    }
protected function getEventAdapter ( EventArgs $ args ) { $ class = get_class ( $ args ) ; if ( preg_match ( '@Doctrine\\\([^\\\]+)@' , $ class , $ m ) && in_array ( $ m [ 1 ] , [ 'ODM' , 'ORM' ] ) ) { if ( ! isset ( $ this -> adapters [ $ m [ 1 ] ] ) ) { $ adapterClass = 'Gedmo\\Mapping\\Event\\Adapter\\' . $ m [ 1 ] ; $ this -> adapters [ $ m [ 1 ] ] = new $ adapterClass ( ) ; } $ this -> adapters [ $ m [ 1 ] ] -> setEventArgs ( $ args ) ; return $ this -> adapters [ $ m [ 1 ] ] ; } throw new \ InvalidArgumentException ( 'Session continaer does not support event arg class: ' . $ class ) ; }
Get an event adapter to handle event specific methods

@param EventArgs $args
@throws \InvalidArgumentException - if event is not recognized
@return AdapterInterface
Get an event adapter to handle event specific methods