Overview

Classes

  • Gravity_Flow_API
  • Gravity_Flow_Step
  • Gravity_Flow_Step_Feed_Add_On
  • Overview
  • Class

Class Gravity_Flow_API

The future-proof way to interact with the high level functions in Gravity Flow.

Class Gravity_Flow_API

Package: GravityFlow\Classes\API
Copyright: Copyright (c) 2015-2018, Steven Henty S.L.
License: GNU Public Licenses
Since: 1.0
Located at
Methods summary
public
# __construct( integer $form_id )

The constructor for the API. Requires a Form ID.

The constructor for the API. Requires a Form ID.

Parameters

$form_id
The current form ID.
public mixed
# add_step( array $step_settings )

Adds a Workflow step to the form with the given settings. The following settings are required: - step_name (string) - step_type (string) - description (string)

Adds a Workflow step to the form with the given settings. The following settings are required: - step_name (string) - step_type (string) - description (string)

Parameters

$step_settings
The step settings (aka feed meta).

Returns

mixed
public Gravity_Flow_Step|boolean
# get_step( integer $step_id, null|array $entry = null )

Returns the step with the given step ID. Optionally pass an Entry object to perform entry-specific functions.

Returns the step with the given step ID. Optionally pass an Entry object to perform entry-specific functions.

Parameters

$step_id
The current step ID.
$entry
The current entry.

Returns

Gravity_Flow_Step|boolean
Returns the Step. False if not found.
public Gravity_Flow_Step[]
# get_steps( )

Returns all the steps for current form.

Returns all the steps for current form.

Returns

Gravity_Flow_Step[]
public Gravity_Flow_Step|boolean
# get_current_step( array $entry )

Returns the current step for the given entry.

Returns the current step for the given entry.

Parameters

$entry
The current entry.

Returns

Gravity_Flow_Step|boolean
public
# process_workflow( integer $entry_id )

Processes the workflow for the given Entry ID. Handles the step orchestration - moving the workflow through the steps and ending the workflow. Not generally required unless there's been a change to the entry outside the usual workflow orchestration.

Processes the workflow for the given Entry ID. Handles the step orchestration - moving the workflow through the steps and ending the workflow. Not generally required unless there's been a change to the entry outside the usual workflow orchestration.

Parameters

$entry_id
The ID of the current entry.
public boolean
# cancel_workflow( array $entry )

Cancels the workflow for the given Entry ID. Removes the assignees, adds a note in the entry's timeline and logs the event.

Cancels the workflow for the given Entry ID. Removes the assignees, adds a note in the entry's timeline and logs the event.

Parameters

$entry
The current entry.

Returns

boolean
True for success. False if not currently in a workflow.
public boolean
# restart_step( array $entry )

Restarts the current step for the given entry, adds a note in the entry's timeline and logs the activity.

Restarts the current step for the given entry, adds a note in the entry's timeline and logs the activity.

Parameters

$entry
The current entry.

Returns

boolean
True for success. False if the entry doesn't have a current step.
public
# restart_workflow( array $entry )

Restarts the workflow for an entry, adds a note in the entry's timeline and logs the activity.

Restarts the workflow for an entry, adds a note in the entry's timeline and logs the activity.

Parameters

$entry
The current entry.
public string|boolean
# get_status( array $entry )

Returns the workflow status for the current entry.

Returns the workflow status for the current entry.

Parameters

$entry
The current entry.

Returns

string|boolean
The status.
public
# send_to_step( array $entry, integer $step_id )

Sends an entry to the specified step.

Sends an entry to the specified step.

Parameters

$entry
The current entry.
$step_id
The ID of the step the entry is to be sent to.
public
# add_timeline_note( integer $entry_id, string $note )

Add a note to the timeline of the specified entry.

Add a note to the timeline of the specified entry.

Parameters

$entry_id
The ID of the current entry.
$note
The note to be added to the timeline.
public
# log_activity( string $log_type, string $event, integer $form_id = 0, integer $entry_id = 0, string $log_value = '', integer $step_id = 0, integer $duration = 0, integer $assignee_id = 0, string $assignee_type = '', string $display_name = '' )

Registers activity event in the activity log. The activity log is used to generate reports.

Registers activity event in the activity log. The activity log is used to generate reports.

Parameters

$log_type
The object of the event: 'workflow', 'step', 'assignee'.
$event
The event which occurred: 'started', 'ended', 'status'.
$form_id
The form ID.
$entry_id
The Entry ID.
$log_value
The value to log.
$step_id
The Step ID.
$duration
The duration in seconds - if applicable.
$assignee_id
The assignee ID - if applicable.
$assignee_type
The Assignee type - if applicable.
$display_name
The display name of the User.
public string
# get_timeline( array $entry )

Returns the timeline for the specified entry with simple formatting.

Returns the timeline for the specified entry with simple formatting.

Parameters

$entry
The current entry.

Returns

string
Properties summary
public integer $form_id

The ID of the Form to be used throughout the Gravity Flow API.

The ID of the Form to be used throughout the Gravity Flow API.

# null
Gravity Flow API documentation generated by ApiGen