When I try to add a first item it gives "Notice: Undefined offset: 0" as an error because of the fact that the array is empty, how can I let the title be "Test" the first time I add an item? The array also needs to be emptied sometimes so it should still work after that
$result = $query->getResult();
if(($result[0]->getId())>0){
$title = "Test" . ($result[0]->getId() + 1);
}
else{
$title = "Test";
}