protected function generateBelongsToColumns($name, Annotation $annotation, EntityDefinition &$entityMetadata)
    {
        $relatedForeignKey = $annotation->relatedForeignKey ?: $this->generateKey($annotation->relatedEntity);

        $entityMetadata['table']['columns'][] = $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
            'name' => $relatedForeignKey,
            'primary' => false,
            'options' => [
                'autoIncrement' => false
            ]
        ]);
    }
protected function generateBelongsToColumns($name, Annotation $annotation, EntityDefinition &$entityMetadata)
    {
        $relatedForeignKey = $annotation->relatedForeignKey ?: $this->generateKey($annotation->relatedEntity);

        $entityMetadata['table']['columns'][] = $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
            'name' => $relatedForeignKey,
            'primary' => false,
            'options' => [
                'autoIncrement' => false
            ]
        ]);
    }
protected function generateBelongsToColumns ( $ name , Annotation $ annotation , EntityDefinition & $ entityMetadata ) { $ relatedForeignKey = $ annotation -> relatedForeignKey ? : $ this -> generateKey ( $ annotation -> relatedEntity ) ; $ entityMetadata [ 'table' ] [ 'columns' ] [ ] = $ this -> getModifiedPrimaryKeyColumn ( $ entityMetadata [ 'table' ] , [ 'name' => $ relatedForeignKey , 'primary' => false , 'options' => [ 'autoIncrement' => false ] ] ) ; }
Generate extra columns for a belongsTo relation.

@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@return void
Generate extra columns for a belongsTo relation .