\Blackpulp\MinistryPlatformRecord

This class handles record-specific interactions.

Summary

Methods
Properties
Constants
__construct()
save()
getId()
getMessage()
getTable()
getFields()
setFields()
getField()
setField()
getPrimaryKey()
getMpInstance()
makeRecurring()
No public properties found
No constants found
setRecordId()
$fields
$table
$record_id
$message
N/A
No private methods found
No private properties found
N/A

Properties

$fields

$fields : array

An array of field names and their values.

Type

array

$table

$table : \Blackpulp\MinistryPlatform\Blackpulp\MinistryPlatform\Table

The associated Table

Type

\Blackpulp\MinistryPlatform\Blackpulp\MinistryPlatform\Table

$record_id

$record_id : integer

The current record ID.

Type

integer

$message

$message : string

The message from the API save operation.

Type

string

Methods

__construct()

__construct(\Blackpulp\MinistryPlatform\Table  $table, \Blackpulp\MinistryPlatform\[type]  $fields) 

Instantiate a Record object.

Parameters

\Blackpulp\MinistryPlatform\Table $table
\Blackpulp\MinistryPlatform\[type] $fields

save()

save() : \Blackpulp\MinistryPlatform\JSON

Save a record to MinistryPlatform.

Returns

\Blackpulp\MinistryPlatform\JSON —

$return

getId()

getId() : integer

Retrieve the current Record's ID.

Returns

integer

getMessage()

getMessage() : string

Return the save operation's message.

Returns

string

getTable()

getTable() : string

Get the table name of the current record.

Returns

string

getFields()

getFields() : array

Get the array of fields of the current record.

Returns

array

setFields()

setFields(array  $fields) 

Update the list of fields on the current record.

Parameters

array $fields

getField()

getField(string  $name) : array

Get the array of fields of the current record.

Parameters

string $name

The name of the field being requested.

Returns

array

setField()

setField(string  $name, string  $value) 

Update the list of fields on the current record.

Parameters

string $name

The name of the field being updated.

string $value

The value of the field being updated.

getPrimaryKey()

getPrimaryKey() : string

Retrieve the name of the Primary_Key field

Returns

string

getMpInstance()

getMpInstance() : \Blackpulp\MinistryPlatform\Blackpulp\MinistryPlatform\MinistryPlatform

Retrieve the current MinistryPlatform instance

Returns

\Blackpulp\MinistryPlatform\Blackpulp\MinistryPlatform\MinistryPlatform

makeRecurring()

makeRecurring() : \Blackpulp\MinistryPlatform\Blackpulp\MinistryPlatform\RecurringRecord

Create a RecurringRecord object from the current record.

Returns

\Blackpulp\MinistryPlatform\Blackpulp\MinistryPlatform\RecurringRecord

setRecordId()

setRecordId() : void

Store the current Record ID.

Check the provided fields to see if we can identify the current Primary Key's value.