protected function getJoins(ForeignKey $fkey, $owningSide = true)
    {
        $joins = array();
        $lcols = $owningSide ? $fkey->getForeigns() : $fkey->getLocals();
        $fcols = $owningSide ? $fkey->getLocals() : $fkey->getForeigns();
        $onDelete = $this->getFormatter()->getDeleteRule($fkey->getParameters()->get('deleteRule'));
        for ($i = 0; $i < count($lcols); $i++) {
            $joins[] = array(
                'name'                  => $lcols[$i]->getColumnName(),
                'referencedColumnName'  => $fcols[$i]->getColumnName(),
                'nullable'              => $lcols[$i]->getNullableValue(),
                'onDelete'              => $onDelete,
            );
        }

        return count($joins) > 1 ? array('joinColumns' => $this->convertJoinColumns($joins)) : array('joinColumn' => $joins[0]);
    }