PA_Attachment
in package
The PuzzleAnywhere attachment class. It allows for attachment metadata info retrieval, general and puzzle url generation, and general and puzzle attachment retrieval.
Table of Contents
- $attachment_name : string
- The internal base name for the attachment.
- $byte_size : int
- The attachment byte size.
- $download_count : int
- The number of times the attachment has been downloaded.
- $download_url : string
- The attachment download URL.
- $ext_type : string
- The attachment extension type.
- $filename : string
- The attachment filename.
- $full_name : int
- The base attachment name with mimetype.
- $human_filesize : string
- A more readable filesize for the attachment.
- $id : int
- The attachment ID.
- $kbyte_size : int
- The attachment kbyte size.
- $max_download_count : int
- The maximum number of times the attachment can be downloaded.
- $mimetype : string
- The attachment mimetype.
- $name : string
- The base name of the attachment.
- $puzzle : object
- The PA_Puzzle object attached to the attachment.
- $puzzle_id : int
- The puzzle ID the attachment belongs to.
- $type : string
- The attachment type.
- download_attachment() : string
- Returns the attachment data.
- download_puzzle_attachment() : string
- Returns the puzzle attachment data.
- download_puzzle_url() : string
- Retrieves the puzzle download URL.
- download_url() : string
- Retrieves the attachment download URL.
- get() : object
- Retrieves attachment metadata from the API server.
Properties
$attachment_name
The internal base name for the attachment.
public
string
$attachment_name
$byte_size
The attachment byte size.
public
int
$byte_size
$download_count
The number of times the attachment has been downloaded.
public
int
$download_count
Defaults to puzzle_attachment.
The number of times the attachment has
been downloaded. Defaults to puzzle_attachment.
$download_url
The attachment download URL.
public
string
$download_url
$ext_type
The attachment extension type.
public
string
$ext_type
The attachment extension type.
$filename
The attachment filename.
public
string
$filename
The attachment filename.
$full_name
The base attachment name with mimetype.
public
int
$full_name
The base attachment name with mimetype.
$human_filesize
A more readable filesize for the attachment.
public
string
$human_filesize
A more readable filesize for the attachment.
$id
The attachment ID.
public
int
$id
The attachment ID.
$kbyte_size
The attachment kbyte size.
public
int
$kbyte_size
The attachment kbyte size.
$max_download_count
The maximum number of times the attachment can be downloaded.
public
int
$max_download_count
The maximum number of times the attachment can be downloaded.
$mimetype
The attachment mimetype.
public
string
$mimetype
The attachment mimetype.
$name
The base name of the attachment.
public
string
$name
The base name of the attachment.
$puzzle
The PA_Puzzle object attached to the attachment.
public
object
$puzzle
The PA_Puzzle object attached to the attachment.
$puzzle_id
The puzzle ID the attachment belongs to.
public
int
$puzzle_id
The puzzle ID the attachment belongs to.
$type
The attachment type.
public
string
$type
The attachment type.
Methods
download_attachment()
Returns the attachment data.
public
download_attachment([mixed $subscr = false ]) : string
Parameters
- $subscr : mixed = false
Return values
string —The attachment data.
download_puzzle_attachment()
Returns the puzzle attachment data.
public
static download_puzzle_attachment(mixed $attachment_id[, mixed $subscr = false ]) : string
Parameters
- $attachment_id : mixed
- $subscr : mixed = false
Return values
string —The puzzle attachment data.
download_puzzle_url()
Retrieves the puzzle download URL.
public
download_puzzle_url([mixed $subscr = false ]) : string
Parameters
- $subscr : mixed = false
Return values
string —The puzzle download URL.
download_url()
Retrieves the attachment download URL.
public
download_url() : string
Return values
string —The attachment download URL.
get()
Retrieves attachment metadata from the API server.
public
static get(int $attachment_id) : object
Parameters
- $attachment_id : int
-
The attachment ID