/** * Get the number of all SMSs that were sent to a selected recipient. * Select recipient by ID. * @param int|string $recipientId * @param boolean $unseen Optional. If you want to get the number of only unseen SMSs. * @return int */ public function count_all_recipient_SMSs($recipientId, $unseen = false) { $sms = new ModelTemplate('SMS'); if ($unseen) { return $sms->count(array('recipient_id', 'is_seen', 'is_resolved'), array($recipientId, 'false', 'false')); } else { return $sms->count('recipient_id', $recipientId); } }
/** * Get the total number of all present truck drivers. * @return int */ public function count_truck_drivers() { $truckDriver = new ModelTemplate('TruckDriver'); return $truckDriver->count(); }