public static function count_records_for_template($templateid, $status) {
        $filters = array('templateid' => $templateid);
        if ($status > 0) {
            $filters['status'] = $status;
        }
        return self::count_records($filters);
    }
public static function count_records_for_template($templateid, $status) {
        $filters = array('templateid' => $templateid);
        if ($status > 0) {
            $filters['status'] = $status;
        }
        return self::count_records($filters);
    }
public static function count_records_for_template ( $ templateid , $ status ) { $ filters = array ( 'templateid' => $ templateid ) ; if ( $ status > 0 ) { $ filters [ 'status' ] = $ status ; } return self :: count_records ( $ filters ) ; }
Count the number of plans for a template, optionally filtering by status.

@param  int $templateid The template ID
@param  int $status The plan status. 0 means all statuses.
@return int
Count the number of plans for a template optionally filtering by status .