public function mapExternalAssociation(
        ExternalAssociation $externalAssociation
    ) {
        // @See https://github.com/doctrine/common/issues/336
        //if (!($referenceManager instanceof DocumentManager || $referenceManager instanceof EntityManagerInterface)) {
        if (!(method_exists($externalAssociation->getReferenceManager(), 'getReference'))) {
            $msg = '$referenceManager needs to implements a `getReference` method';
            throw new \InvalidArgumentException($msg);
        }

        $this->eventListener->addExternalAssoctiation($externalAssociation);


        $externalAssociation->getObjectManager()
            ->getEventManager()
            ->addEventListener(['postLoad'], $this->eventListener);
        // todo switch to doctrine event when https://github.com/doctrine/common/pull/335 is merged
    }
public function mapExternalAssociation(
        ExternalAssociation $externalAssociation
    ) {
        // @See https://github.com/doctrine/common/issues/336
        //if (!($referenceManager instanceof DocumentManager || $referenceManager instanceof EntityManagerInterface)) {
        if (!(method_exists($externalAssociation->getReferenceManager(), 'getReference'))) {
            $msg = '$referenceManager needs to implements a `getReference` method';
            throw new \InvalidArgumentException($msg);
        }

        $this->eventListener->addExternalAssoctiation($externalAssociation);


        $externalAssociation->getObjectManager()
            ->getEventManager()
            ->addEventListener(['postLoad'], $this->eventListener);
        // todo switch to doctrine event when https://github.com/doctrine/common/pull/335 is merged
    }
public function mapExternalAssociation ( ExternalAssociation $ externalAssociation ) { // @See https://github.com/doctrine/common/issues/336 //if (!($referenceManager instanceof DocumentManager || $referenceManager instanceof EntityManagerInterface)) { if ( ! ( method_exists ( $ externalAssociation -> getReferenceManager ( ) , 'getReference' ) ) ) { $ msg = '$referenceManager needs to implements a `getReference` method' ; throw new \ InvalidArgumentException ( $ msg ) ; } $ this -> eventListener -> addExternalAssoctiation ( $ externalAssociation ) ; $ externalAssociation -> getObjectManager ( ) -> getEventManager ( ) -> addEventListener ( [ 'postLoad' ] , $ this -> eventListener ) ; // todo switch to doctrine event when https://github.com/doctrine/common/pull/335 is merged }
Map an external association between two differents Object Manager

@param ExternalAssociation $externalAssociation the external association object
@access public
@return void
Map an external association between two differents Object Manager