We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

LeftJoin Same table twice

Hi, I'm trying to make a leftJoin in the same table twitce, but only retrieve c, and m2 columns

$select =
    $this->getModelsManager()->createBuilder()
        ->addFrom('\\Apps\\Models\\Conteudos', 'c')
        ->leftJoin('\\Apps\\Models\\Midias', 'm.id = c.id_midias', 'm')
        ->leftJoin('\\Apps\\Models\\Midias', 'm2.id = c.id_destaque', 'm2')
        ->columns( array( 'c.*','m.*', 'm2.*'));


9.7k
Accepted
answer

Sorry can be closes 2.0.3 problem is gone!!