\Blackpulp\MinistryPlatformFile

This class handles File-based interactions.

Summary

Methods
Properties
Constants
__construct()
attach()
getName()
getIsImage()
getDescription()
getMessage()
getBinary()
getPageId()
getRecordId()
getPixels()
getGuid()
makeDefault()
No public properties found
No constants found
No protected methods found
$description
$is_image
$binary
$name
$page_id
$record_id
$pixels
$mp
$message
$guid
N/A
No private methods found
No private properties found
N/A

Properties

$description

$description : string

The description stored on the new File record

Type

string

$is_image

$is_image : boolean

Stored whether the file is an image.

Type

boolean

$binary

$binary : \Blackpulp\MinistryPlatform\binary

The byte array of binary data for the file.

Type

\Blackpulp\MinistryPlatform\binary

$name

$name : string

The name of the file

Type

string

$page_id

$page_id : integer

The MinistryPlatform Page ID the file is associated with

Type

integer

$record_id

$record_id : integer

The record ID the file is associated with.

Type

integer

$pixels

$pixels : integer

The number of pixels to resize the longest side of an image.

Enter a value of 0 to keep the original dimensions.

Type

integer

$message

$message : string

The message returned from the most recent API operation.

Type

string

$guid

$guid : \Blackpulp\MinistryPlatform\guid

The GUID of the current file

Type

\Blackpulp\MinistryPlatform\guid

Methods

__construct()

__construct(string  $file_name, string  $temp_name, string  $description, integer  $page_id, integer  $record_id, boolean  $is_image, integer  $pixels, \Blackpulp\MinistryPlatform\MinistryPlatform  $mp = null) 

Initialize a File object.

Parameters

string $file_name

The name of the file as it will be saved into MinistryPlatform.

string $temp_name

The absolute physical path of the temp file's name.

string $description

A description of the file.

integer $page_id

The Page_ID value of the Record's Table in MinistryPlatform.

integer $record_id

The ID of the Record the file will be attached to in MinistryPlatform.

boolean $is_image

Simple boolean to determine whether the file is an image.

integer $pixels

Number of pixels to resize the longest side of an image. Use 0 to retain the original dimensions.

\Blackpulp\MinistryPlatform\MinistryPlatform $mp

attach()

attach() : \Blackpulp\MinistryPlatform\[type]

Attach a file to a record.

Returns

\Blackpulp\MinistryPlatform\[type] —

[description]

getName()

getName() : string

Get the name of the current file

Returns

string

getIsImage()

getIsImage() : boolean

Whether the current file is an image.

Returns

boolean

getDescription()

getDescription() : string

Get the file's description

Returns

string

getMessage()

getMessage() : string

Return the message from the last successful API call.

Returns

string

getBinary()

getBinary() : \Blackpulp\MinistryPlatform\binary

Retrieves the binary representation of the current file.

Returns

\Blackpulp\MinistryPlatform\binary

getPageId()

getPageId() : integer

Get the File's Page_ID

Returns

integer

getRecordId()

getRecordId() : integer

Return the file's associated Record ID

Returns

integer

getPixels()

getPixels() : integer

Get the pixel resizing value

Returns

integer

getGuid()

getGuid() : string

Retrieve the File GUID

Returns

string

makeDefault()

makeDefault() : $this

Make the current file the default for a record. Note that the is_image property must be true.

Returns

$this