public static function get_records_for_template($templateid, $status = 0, $skip = 0, $limit = 100) {
        $filters = array('templateid' => $templateid);
        if ($status > 0) {
            $filters['status'] = $status;
        }
        return self::get_records($filters, $skip, $limit);
    }
public static function get_records_for_template($templateid, $status = 0, $skip = 0, $limit = 100) {
        $filters = array('templateid' => $templateid);
        if ($status > 0) {
            $filters['status'] = $status;
        }
        return self::get_records($filters, $skip, $limit);
    }
public static function get_records_for_template ( $ templateid , $ status = 0 , $ skip = 0 , $ limit = 100 ) { $ filters = array ( 'templateid' => $ templateid ) ; if ( $ status > 0 ) { $ filters [ 'status' ] = $ status ; } return self :: get_records ( $ filters , $ skip , $ limit ) ; }
Get the plans for a template, optionally filtering by status.

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