The present invention relates to derivatives of 4-{2-[phenyl-3,6-dihydropyridin-1-yl]-2-oxoalkyl}-1-piperazin-2-one and 4-{2-[phenyl-2,5-dihydropyrrol-1-yl]-2-oxoalkyl}-1-piperazin-2-one having general formula (I): in which A, B, m, R3 and n are as defined herein. The invention also relates to the preparation thereof and to the therapeutic use thereof.