MarketData SDK

Lookup extends ResponseBase
in package

Represents a lookup response for generating OCC option symbols.

Table of Contents

Properties

$_saved_filename  : string|null
$option_symbol  : string|null
The generated OCC option symbol based on the user's input.
$status  : string
Status of the lookup request. Will always be ok when the OCC option symbol is successfully generated.
$csv  : string
$html  : string

Methods

__construct()  : mixed
Constructs a new Lookup instance from the given response object.
__toString()  : string
Returns a string representation of the lookup result.
getCsv()  : string
Get the CSV content of the response.
getHtml()  : string
Get the HTML content of the response.
isCsv()  : bool
Check if the response is in CSV format.
isHtml()  : bool
Check if the response is in HTML format.
isJson()  : bool
Check if the response is in JSON format.
saveToFile()  : string
Save CSV/HTML content to a file.

Properties

$_saved_filename

public string|null $_saved_filename = null

The filename where the response was saved (if filename parameter was used).

$option_symbol

The generated OCC option symbol based on the user's input.

public string|null $option_symbol = null

$status

Status of the lookup request. Will always be ok when the OCC option symbol is successfully generated.

public string $status = 'no_data'

$csv

protected string $csv

The CSV content of the response.

$html

protected string $html

The HTML content of the response.

Methods

__construct()

Constructs a new Lookup instance from the given response object.

public __construct(object $response) : mixed
Parameters
$response : object

The response object containing lookup data.

__toString()

Returns a string representation of the lookup result.

public __toString() : string
Return values
string

Human-readable lookup result.

getCsv()

Get the CSV content of the response.

public getCsv() : string
Tags
throws
InvalidArgumentException

If the response is not in CSV format.

Return values
string

The CSV content.

getHtml()

Get the HTML content of the response.

public getHtml() : string
Tags
throws
InvalidArgumentException

If the response is not in HTML format.

Return values
string

The HTML content.

isCsv()

Check if the response is in CSV format.

public isCsv() : bool
Return values
bool

True if the response is in CSV format, false otherwise.

isHtml()

Check if the response is in HTML format.

public isHtml() : bool
Return values
bool

True if the response is in HTML format, false otherwise.

isJson()

Check if the response is in JSON format.

public isJson() : bool
Return values
bool

True if the response is in JSON format, false otherwise.

saveToFile()

Save CSV/HTML content to a file.

public saveToFile(string $filename) : string
Parameters
$filename : string

The file path to save to.

Tags
throws
InvalidArgumentException

If filename is invalid (wrong extension, etc.).

throws
RuntimeException

If file writing fails.

Return values
string

The absolute path of the saved file.


        
On this page

Search results