public function getTroughMapping($mappingId, $id)
    {
        $config            = $this->mapping[ $mappingId ];
        $dataStoreService  = $this->container->get("data.source");
        $externalDataStore = $dataStoreService->get($config["externalDataStore"]);
        $externalDriver    = $externalDataStore->getDriver();
        $internalFieldName = null;
        $externalFieldName = null;

        if (isset($config['internalId'])) {
            $internalFieldName = $config['internalId'];
        }

        if (isset($config['externalId'])) {
            $externalFieldName = $config['externalId'];
        }

        if (isset($config['internalFieldName'])) {
            $internalFieldName = $config['internalFieldName'];
        }

        if (isset($config['relatedFieldName'])) {
            $externalFieldName = $config['relatedFieldName'];
        }

        if (!$externalDriver instanceof DoctrineBaseDriver) {
            throw new Exception('This kind of externalDriver can\'t get relations');
        }

        $criteria = $this->get($id)->getAttribute($internalFieldName);

        return $externalDriver->getByCriteria($criteria, $externalFieldName);
    }
public function getTroughMapping($mappingId, $id)
    {
        $config            = $this->mapping[ $mappingId ];
        $dataStoreService  = $this->container->get("data.source");
        $externalDataStore = $dataStoreService->get($config["externalDataStore"]);
        $externalDriver    = $externalDataStore->getDriver();
        $internalFieldName = null;
        $externalFieldName = null;

        if (isset($config['internalId'])) {
            $internalFieldName = $config['internalId'];
        }

        if (isset($config['externalId'])) {
            $externalFieldName = $config['externalId'];
        }

        if (isset($config['internalFieldName'])) {
            $internalFieldName = $config['internalFieldName'];
        }

        if (isset($config['relatedFieldName'])) {
            $externalFieldName = $config['relatedFieldName'];
        }

        if (!$externalDriver instanceof DoctrineBaseDriver) {
            throw new Exception('This kind of externalDriver can\'t get relations');
        }

        $criteria = $this->get($id)->getAttribute($internalFieldName);

        return $externalDriver->getByCriteria($criteria, $externalFieldName);
    }
public function getTroughMapping ( $ mappingId , $ id ) { $ config = $ this -> mapping [ $ mappingId ] ; $ dataStoreService = $ this -> container -> get ( "data.source" ) ; $ externalDataStore = $ dataStoreService -> get ( $ config [ "externalDataStore" ] ) ; $ externalDriver = $ externalDataStore -> getDriver ( ) ; $ internalFieldName = null ; $ externalFieldName = null ; if ( isset ( $ config [ 'internalId' ] ) ) { $ internalFieldName = $ config [ 'internalId' ] ; } if ( isset ( $ config [ 'externalId' ] ) ) { $ externalFieldName = $ config [ 'externalId' ] ; } if ( isset ( $ config [ 'internalFieldName' ] ) ) { $ internalFieldName = $ config [ 'internalFieldName' ] ; } if ( isset ( $ config [ 'relatedFieldName' ] ) ) { $ externalFieldName = $ config [ 'relatedFieldName' ] ; } if ( ! $ externalDriver instanceof DoctrineBaseDriver ) { throw new Exception ( 'This kind of externalDriver can\'t get relations' ) ; } $ criteria = $ this -> get ( $ id ) -> getAttribute ( $ internalFieldName ) ; return $ externalDriver -> getByCriteria ( $ criteria , $ externalFieldName ) ; }
Get related objects through mapping

@param $mappingId
@param $id
@return DataItem[]
Get related objects through mapping