1
hello everybody,
I have a problem using criteria and unset function.
Issue is : whane I use cirteria in a function a a parameter and I use unset on that criteria in this function, when I exit function this criteria is empty.
first I call the function with my criteria
$eta_handler->getObjectWithJoin($criteria);
then I use unset in that function
function getObjectWithJoin( $criteria ){
.....
if (!empty($criteria->criteriaElements))
{
.....
foreach ($criteria->criteriaElements as $indice=>$criteriaElement)
{
...
unset($criteria->criteriaElements[$indice-$indice_eval]);
...
}
...
}
}
than I call my function a second time with my criteria
$eta_handler->getObjectWithJoin($criteria);
But this time criteriaElements is empty
I tried with a copy ($criteria2 = criteria) for the second call but I had same result.
Does anybody could explain me what happens or has an idea to have my criteria not empty i nthe second call of my function ?
thanks for that.