/** * @return int The total number of orderlines that are open. */ public static function openOrderlinesTotal() { $total = 0; foreach (OrderLine::whereNull('payed_with_withdrawal')->get() as $orderline) { if ($orderline->isPayed()) { continue; } $total++; } return $total; }