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

How to use the methode Replace using an OO interface

Hello,

I'm a new about the programing, phalcon and english, but i hope you understand about my problem.

I'm trying to use Replace on a table and remove the " - ", but i don't know how to do.

$joinRegiao = [
                "model" => "Midas\Models\Regional\RegionalCep",
                "equal" => "REPLACE('Midas\Models\Enderecos.cep', '-', '') BETWEEN Midas\Models\Regional\RegionalCep.faixa1 AND Midas\Models\Regional\RegionalCep.faixa2"
            ];

Then i compare model and equal with a INNER JOIN and print it.

How can i use the Replace in this case?



32.3k
Accepted
answer

Hi Arthur the replace function it isn't supported by default on PHQL. You have to extends your Mysql Dialect see this example.

Good luck

Thank you!