Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • Docs Home

Packages

  • BKAP
    • Addons
    • Admin-Bookings
    • Attribute-Lockout
    • Block-Pricing
    • Booking-Box
    • Booking-Confirmation
    • Booking-Process
    • Cancel-Order
    • Cart
    • Checkout-Process
    • Core
    • Date-Time
    • Emails
    • Functions
    • Global-Function
    • Global-Settings
    • Google-Calendar-Sync
    • ICS
    • Import-Booking
    • Labels
    • License
    • Menus
    • Meta-Boxes
    • Reschedule
    • Resources
    • Search-Widget
    • Special-Price
    • Uninstall
    • Validation
    • Variation-Lockout
    • Vendors
      • Dokan
      • WC-Vendors
    • View-Bookings
  • None

Classes

  • bkap_calendar_sync
  • BKAP_Gcal
  • BKAP_Gcal_Event
  • bkap_gcal_sync_settings
  • BKAP_Google_Events_View
  • product_gcal_settings
  • WAPBK_Import_Bookings_Table

Functions

  • bkap_import_events_cron
  • woocommerce_bkap_add_cron_schedule

Class BKAP_Gcal

Class for Google Calendar API for WooCommerce Booking and Appointment Plugin

Package: BKAP\Google-Calendar-Sync
Author: Tyche Softwares
Class: BKAP_Gcal
Located at includes/class.gcal.php

Methods summary

public
# __construct( )

Construct

Construct

public
# exception_error_handler( string $exception )

Refresh the page with the exception as GET parameter, so that page is not killed

Refresh the page with the exception as GET parameter, so that page is not killed

Parameters

$exception

Since

2.6
public
# display_nag( )

Displays Messages

Displays Messages

Since

2.6
public
# bkap_init( )

Set some default settings related to GCal

Set some default settings related to GCal

Since

2.6
public string
# create_key_file_folder( )

Try to create an encrypted key file folder

Try to create an encrypted key file folder

Returns

string

Since

2.6
public string
# get_api_mode( integer $user_id, integer $product_id = 0 )

Return GCal API mode (directly, manual, disabled )

Return GCal API mode (directly, manual, disabled )

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

string

Since

2.6
public string
# get_service_account( integer $user_id, integer $product_id )

Return GCal service account

Return GCal service account

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

string

Since

2.6
public string
# get_key_file( integer $user_id, integer $product_id )

Return GCal key file name without the extension

Return GCal key file name without the extension

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

string

Since

2.6
public string
# get_selected_calendar( integer $user_id, integer $product_id )

Return GCal selected calendar ID

Return GCal selected calendar ID

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

string

Since

2.6
public string
# get_summary( )

Return GCal Summary (name of Event)

Return GCal Summary (name of Event)

Returns

string

Since

2.6
public string
# get_description( )

Return GCal description

Return GCal description

Returns

string

Since

2.6
public string
# is_not_suitable( integer $user_id, integer $product_id )

Checks if php version and extentions are correct

Checks if php version and extentions are correct

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

string
(Empty string means suitable)

Since

2.6
public boolean
# _file_exists( integer $user_id, integer $product_id )

Checks if key file exists

Checks if key file exists

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

boolean

Since

2.6
public string
# _file_get_contents( integer $user_id, integer $product_id )

Get contents of the key file

Get contents of the key file

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

string

Since

2.6
public string
# key_file_folder( )

Return key file folder name

Return key file folder name

Returns

string

Since

2.6
public boolean
# is_active( integer $user_id, integer $product_id )

Checks for settings and prerequisites

Checks for settings and prerequisites

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

boolean

Since

2.6
public boolean
# connect( integer $user_id, integer $product_id )

Connects to GCal API

Connects to GCal API

Parameters

$user_id
  • User ID. Greater than 0 for Tor Operator calendars
$product_id
  • Product ID. Greater than 0 for product level calendars.

Returns

boolean

Since

2.6
public
# set_event_parameters( app: $app )

Creates a Google Event object and set its parameters

Creates a Google Event object and set its parameters

Parameters

$app
object to be set as event

Since

2.6
public
# delete_event( integer $item_id, integer $user_id, integer $product_id )

Delete event from Gcal when an order is cancelled.

Delete event from Gcal when an order is cancelled.

Parameters

$item_id
  • Item ID
$user_id
  • User ID - to be passed for tour operator calendars
$product_id
  • Product ID, Greater than 0 for product level calendars

Since

2.6.3
public boolean
# insert_event( array $event_details, integer $event_id, integer $user_id, integer $product_id = 0, boolean $test = false )

Inserts a booking to the selected calendar as event

Inserts a booking to the selected calendar as event

Parameters

$event_details
  • Details such as start & end dates, time, product, qty etc.
$event_id
  • Item ID
$user_id
  • Passed for tour operators
$product_id
  • Passed for product level calendars
$test
True if a Test booking is being created, else false

Returns

boolean

Since

2.6
public
# log( string $message = '' )

Used to log messages in the bkap-log file.

Used to log messages in the bkap-log file.

Parameters

$message

Since

2.6
public string
# gcal( object $bkap )

Build GCal url for GCal Button. It requires UTC time.

Build GCal url for GCal Button. It requires UTC time.

Parameters

$bkap
  • Contains booking details like start date, end date, product, qty etc.

Returns

string

Since

2.6
public string
# other_cal( object $bkap )

Build URL for Other Calendar button. It requires UTC time.

Build URL for Other Calendar button. It requires UTC time.

Parameters

$bkap
  • Contains booking details like start date, end date, product, qty etc.

Returns

string

Since

2.6
public string
# outlook_cal( object $bkap )

Build URL for Outlook Calendar. It requires UTC time.

Build URL for Outlook Calendar. It requires UTC time.

Parameters

$bkap
  • Contains booking details like start date, end date, product, qty etc.

Returns

string

Since

2.6
API documentation generated by ApiGen