/** * Given the current number milestone, it returns the next one for the goal */ public static function findNextMilestoneInGoal($curr) { return Milestones::findFirst(array("goalID = :goalID: AND number = :number:", "bind" => array('goalID' => $goalID, 'number' => $curr++))); }