Skip to main content

Gravity_Flow_Assignee

Class Gravity_Flow_Assignee

Source: includes/assignees/class-assignee.php:20

Details

  • Kind: class
  • Namespace: (global)

Properties

PropertyTypeDescription
$namestringThe unique name of this assignee.
$idstringThe ID of this assignee.
$typestringThe Type of this assignee.
$keystringThe Assignee key.
$editable_fieldsarrayThe editable fields for this assignee.
$userWP_UserThe WordPress user account for this assignee
$stepGravity_Flow_Step | boolThe step.

Methods

MethodDescription
__construct()Gravity_Flow_Assignee constructor.
get_id()Return the assignee ID.
get_key()Return the assignee key.
get_type()Return the assignee type.
get_step()Return the step for this assignee.
get_editable_fields()Return the editable field IDs for this assignee.
get_user()Returns the user account for this assignee.
get_status()Returns the status.
get_status_key()Returns the status key.
update_status()Update the status entry meta items for this assignee.
get_display_name()Return the assignee display name.
remove()Remove the assignee from the current step by deleting the associated entry meta items.
get_status_timestamp()Returns the status timestamp.
get_reminder_timestamp()Returns the status timestamp.
set_reminder_timestamp()Sets the timestamp for the reminder.
log_event()Log an event for the current assignee.
send_notification()Sends a notification to the assignee.
is_current_user()Checks whether the current user (WP or Token auth) is an assignee.
process_status()Processes the status update for the assignee.
get_status_label()Returns the label to be displayed for the assignee on the workflow detail page.
replace_variables()Override this method to replace merge tags.

Method Reference

__construct()

public function __construct( $args=[], $step=false )

Gravity_Flow_Assignee constructor.

Parameters

NameTypeDefaultDescription
$argsstring | array[]An assignee key or array.
$stepbool | Gravity_Flow_StepfalseThe current step or false.

Since: 1.0

Source: includes/assignees/class-assignee.php:95

get_id()

public function get_id()

Return the assignee ID.

Returns

  • string

Source: includes/assignees/class-assignee.php:183

get_key()

public function get_key()

Return the assignee key.

Returns

  • string

Source: includes/assignees/class-assignee.php:192

get_type()

public function get_type()

Return the assignee type.

Returns

  • string

Source: includes/assignees/class-assignee.php:201

get_step()

public function get_step()

Return the step for this assignee.

Returns

Since: 2.3.2

Source: includes/assignees/class-assignee.php:212

get_editable_fields()

public function get_editable_fields()

Return the editable field IDs for this assignee.

Returns

  • array

Source: includes/assignees/class-assignee.php:221

get_user()

public function get_user()

Returns the user account for this assignee.

Returns

Since: 1.7.1

Source: includes/assignees/class-assignee.php:232

get_status()

public function get_status()

Returns the status.

Returns

  • bool | mixed

Source: includes/assignees/class-assignee.php:241

get_status_key()

public function get_status_key()

Returns the status key.

Returns

  • string

Source: includes/assignees/class-assignee.php:260

update_status()

public function update_status( $new_assignee_status=false )

Update the status entry meta items for this assignee.

Parameters

NameTypeDefaultDescription
$new_assignee_statusstring | boolfalseThe new status for this assignee or false.

Source: includes/assignees/class-assignee.php:275

get_display_name()

public function get_display_name()

Return the assignee display name.

Returns

  • string

Source: includes/assignees/class-assignee.php:294

remove()

public function remove()

Remove the assignee from the current step by deleting the associated entry meta items.

Source: includes/assignees/class-assignee.php:304

get_status_timestamp()

public function get_status_timestamp()

Returns the status timestamp.

Returns

  • bool | mixed

Source: includes/assignees/class-assignee.php:320

get_reminder_timestamp()

public function get_reminder_timestamp()

Returns the status timestamp.

Returns

  • bool | mixed

Source: includes/assignees/class-assignee.php:333

set_reminder_timestamp()

public function set_reminder_timestamp( $timestamp=false )

Sets the timestamp for the reminder.

Parameters

NameTypeDefaultDescription
$timestampbool | intfalseUnix GMT timestamp or false.

Source: includes/assignees/class-assignee.php:346

log_event()

public function log_event( $status, $duration=0 )

Log an event for the current assignee.

Parameters

NameTypeDefaultDescription
$statusstringThe assignee status.
$durationint0Time interval in seconds, if any.

Source: includes/assignees/class-assignee.php:364

send_notification()

public function send_notification( $notification )

Sends a notification to the assignee.

Parameters

NameTypeDefaultDescription
$notificationarrayThe notification to be sent.

Since: 2.1

Source: includes/assignees/class-assignee.php:377

is_current_user()

public function is_current_user()

Checks whether the current user (WP or Token auth) is an assignee.

Returns

  • bool

Since: 2.1

Source: includes/assignees/class-assignee.php:465

process_status()

public function process_status( $new_status )

Processes the status update for the assignee.

Parameters

NameTypeDefaultDescription
$new_statusstringThe status string e.g. complete, approved, rejected.

Returns

  • bool | WP_Error — True on success or WP_Error

Since: 2.1

Source: includes/assignees/class-assignee.php:506

get_status_label()

public function get_status_label()

Returns the label to be displayed for the assignee on the workflow detail page.

Returns

  • string

Since: 2.1

Source: includes/assignees/class-assignee.php:536

replace_variables()

public function replace_variables( $text )

Override this method to replace merge tags.

Important: call the parent method first. $text = parent::replace_variables( $text );

Parameters

NameTypeDefaultDescription
$textstringThe text containing merge tags to be processed.

Returns

  • string

Since: 2.1

Source: includes/assignees/class-assignee.php:598