I'm using Phalcon 3 and I have a problem with my query. I want to find if the row already exist.
$colA = $data['columnA'] ?? null;
$colB = $data['columnB'] ?? null;
$colC = $data['columnC'] ?? null;
$robot = Robots::findFirst(array(
"columnA = :columnA: AND columnB = :columnB: AND columnC = :columnC:",
"bind" => array("columnA" => $colA, "columnB" => $colB, "columnC" => $colC)
));
The problem is that if one of these variable is null I need to replace my conditon by IS NULL
else my query will not work because the query will use colA = null
.
Does Phalcon can resolve this problem ?