public function prepareAssociatedDocumentValue(array $mapping, $document, $includeNestedCollections = false)
    {
        if (isset($mapping['embedded'])) {
            return $this->prepareEmbeddedDocumentValue($mapping, $document, $includeNestedCollections);
        }

        if (isset($mapping['reference'])) {
            return $this->prepareReferencedDocumentValue($mapping, $document);
        }

        throw new InvalidArgumentException('Mapping is neither embedded nor reference.');
    }
public function prepareAssociatedDocumentValue(array $mapping, $document, $includeNestedCollections = false)
    {
        if (isset($mapping['embedded'])) {
            return $this->prepareEmbeddedDocumentValue($mapping, $document, $includeNestedCollections);
        }

        if (isset($mapping['reference'])) {
            return $this->prepareReferencedDocumentValue($mapping, $document);
        }

        throw new InvalidArgumentException('Mapping is neither embedded nor reference.');
    }
public function prepareAssociatedDocumentValue ( array $ mapping , $ document , $ includeNestedCollections = false ) { if ( isset ( $ mapping [ 'embedded' ] ) ) { return $ this -> prepareEmbeddedDocumentValue ( $ mapping , $ document , $ includeNestedCollections ) ; } if ( isset ( $ mapping [ 'reference' ] ) ) { return $ this -> prepareReferencedDocumentValue ( $ mapping , $ document ) ; } throw new InvalidArgumentException ( 'Mapping is neither embedded nor reference.' ) ; }
Returns the embedded document or reference representation to be stored.

@param array  $mapping
@param object $document
@param bool   $includeNestedCollections

@return array|object|null

@throws InvalidArgumentException If the mapping is neither embedded nor reference.
Returns the embedded document or reference representation to be stored .