original_string: 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
      }
code: 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
      }
code_tokens: 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 }
docstring: Map an external association between two differents Object Manager
  
  @param ExternalAssociation $externalAssociation the external association object
  @access public
  @return void
docstring_tokens: Map an external association between two differents Object Manager