Tuesday 31 August 2010 6:21:31 am
Hi there, I would like to know why the following pieces of code don't works : 1. I create an array with all my search filters
$criteres = array("and");
if($siren != "")
$criteres[] = array('etablissement/n_siren', 'like', "*$siren*"); I do this piece of code for a lot of criters, adding a sub array to the criteres array. 2. I launch my fetch :
$entreprises = eZContentObjectTreeNode::subTreeByNodeID(
array(
'ClassFilterType' => 'include',
'ClassFilterArray' => array('etablissement'),
'AttributeFilter' => $criteres
),
2283
); But there is nothing in $entreprises... There is things I don't understand : why the same code :
if($tel != "")
$criteres[] = array('etablissement/tel', 'like', "*$tel*"); and
if($nom != ""){
$criteres[] = array('etablissement/nom', 'like', "*$nom*");
$criteres[] = array('etablissement/nom_enseigne', 'like', "*$nom*");
} don't do the same thing ?
>> For the phone number ($tel), it works perfectly even if the number is not complete. >> But for the name ($nom), there is nothing (even with the complete name or part of the name). Could someone explain me what is wrong ? Or why does it works like this ? Thanks
|