# Table of Contents - [LegiScan API Client](#legiscan-api-client) - [Package LegiScan | LegiScan API Client](#package-legiscan-legiscan-api-client) - [Package LegiScan\API | LegiScan API Client](#package-legiscan-api-legiscan-api-client) - [Package LegiScan\Cache | LegiScan API Client](#package-legiscan-cache-legiscan-api-client) - [Package LegiScan\Exceptions | LegiScan API Client](#package-legiscan-exceptions-legiscan-api-client) - [Package LegiScan\Common | LegiScan API Client](#package-legiscan-common-legiscan-api-client) - [Package LegiScan\Utility | LegiScan API Client](#package-legiscan-utility-legiscan-api-client) - [Class LegiScan | LegiScan API Client](#class-legiscan-legiscan-api-client) - [Package PHP | LegiScan API Client](#package-php-legiscan-api-client) - [Class LegiScan_Bulk | LegiScan API Client](#class-legiscan-bulk-legiscan-api-client) - [Class LegiScan_Cache_File | LegiScan API Client](#class-legiscan-cache-file-legiscan-api-client) - [Class LegiScan_Cache_Memory | LegiScan API Client](#class-legiscan-cache-memory-legiscan-api-client) - [Class LegiScan_Push | LegiScan API Client](#class-legiscan-push-legiscan-api-client) - [Class LegiScan_CommandLine | LegiScan API Client](#class-legiscan-commandline-legiscan-api-client) - [Class LegiScan_Endpoint | LegiScan API Client](#class-legiscan-endpoint-legiscan-api-client) - [Class LegiScan_WebTest | LegiScan API Client](#class-legiscan-webtest-legiscan-api-client) - [Class LegiScan_Worker | LegiScan API Client](#class-legiscan-worker-legiscan-api-client) - [Class LegiScan_Pull | LegiScan API Client](#class-legiscan-pull-legiscan-api-client) - [Class LegiScan_Import | LegiScan API Client](#class-legiscan-import-legiscan-api-client) - [Class LegiScan_Process | LegiScan API Client](#class-legiscan-process-legiscan-api-client) - [Class APIAccessException | LegiScan API Client](#class-apiaccessexception-legiscan-api-client) - [Class APIAuthTokenException | LegiScan API Client](#class-apiauthtokenexception-legiscan-api-client) - [Class APIException | LegiScan API Client](#class-apiexception-legiscan-api-client) - [Class APIStatusException | LegiScan API Client](#class-apistatusexception-legiscan-api-client) - [Function expect_user | LegiScan API Client](#function-expect-user-legiscan-api-client) - [Function is_cli | LegiScan API Client](#function-is-cli-legiscan-api-client) - [Function legiscan_getopt | LegiScan API Client](#function-legiscan-getopt-legiscan-api-client) - [Function legiscan_help | LegiScan API Client](#function-legiscan-help-legiscan-api-client) - [Function legiscan_option | LegiScan API Client](#function-legiscan-option-legiscan-api-client) - [Function memory_usage | LegiScan API Client](#function-memory-usage-legiscan-api-client) - [Function prettyPrint | LegiScan API Client](#function-prettyprint-legiscan-api-client) - [Function sec2hms | LegiScan API Client](#function-sec2hms-legiscan-api-client) - [Function timer_clear | LegiScan API Client](#function-timer-clear-legiscan-api-client) - [Function timer_read | LegiScan API Client](#function-timer-read-legiscan-api-client) - [Function timer_start | LegiScan API Client](#function-timer-start-legiscan-api-client) - [Function timer_stop | LegiScan API Client](#function-timer-stop-legiscan-api-client) - [Function yes_no_prompt | LegiScan API Client](#function-yes-no-prompt-legiscan-api-client) - [Interface Traversable | LegiScan API Client](#interface-traversable-legiscan-api-client) - [Class PDOException | LegiScan API Client](#class-pdoexception-legiscan-api-client) - [Class RuntimeException | LegiScan API Client](#class-runtimeexception-legiscan-api-client) - [Class PDOStatement | LegiScan API Client](#class-pdostatement-legiscan-api-client) - [Class PDO | LegiScan API Client](#class-pdo-legiscan-api-client) - [Class Exception | LegiScan API Client](#class-exception-legiscan-api-client) --- # LegiScan API Client Overview ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) * [LegiScan\_Cache\_File](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html) * [LegiScan\_Cache\_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) * [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) * [LegiScan\_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * Overview * Package * Class LegiScan API Client =================== The LegiScan API Client is provided as a means to quickly get started working with API data along with a provided database schema ([ERD](https://api.legiscan.com/dl/Database_ERD.png "Entity Relationship Diagram") ). > Source code and installation instructions are available at: [LegiScan API Client Downloads](https://api.legiscan.com/dl/ "LegiScan API Client Downloads") > API information and registration available at: [LegiScan API Registration](https://legiscan.com/legiscan "LegiScan API") The [bulk import utility](https://api.legiscan.com/docs/class-LegiScan_Import.html "Bulk Import Utility") is a great place to start to immediately onboard data. For experimenting with API try the [command line interface](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html "Command Line Interface") or the [web interface](https://api.legiscan.com/docs/class-LegiScan_WebTest.html "Web Interface") . And for a deeper dive into the API internals look into [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html "JSON Pull Interface") and [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html "JSON Database Processor") . | | | --- |Packages summary | [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) | | [LegiScan\\API](https://api.legiscan.com/docs/package-LegiScan.API.html) | | [LegiScan\\Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) | | [LegiScan\\Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) | | [LegiScan\\Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) | | [LegiScan\\Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) | --- # Package LegiScan | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Package LegiScan ================ | | | --- |Packages summary | [LegiScan\\API](https://api.legiscan.com/docs/package-LegiScan.API.html) | | [LegiScan\\Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) | | [LegiScan\\Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) | | [LegiScan\\Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) | | [LegiScan\\Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) | --- # Package LegiScan\API | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) * [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) * [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) * [LegiScan\_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Package [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\API ============================================================================= | | | | --- | --- |Classes summary | [LegiScan\_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) | LegiScan API Bulk Dataset Class | | [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) | LegiScan API Database Process Class | | [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) | LegiScan API Pull Interface Class | | [LegiScan\_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) | LegiScan API Push Interface Class | --- # Package LegiScan\Cache | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Cache\_File](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html) * [LegiScan\_Cache\_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Package [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\Cache =============================================================================== | | | | --- | --- |Classes summary | [LegiScan\_Cache\_File](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html) | LegiScan API File Cache Class | | [LegiScan\_Cache\_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) | LegiScan API Memory Cache Class | --- # Package LegiScan\Exceptions | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Exceptions * [APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) * [APIAuthTokenException](https://api.legiscan.com/docs/class-APIAuthTokenException.html) * [APIException](https://api.legiscan.com/docs/class-APIException.html) * [APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Package [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\Exceptions ==================================================================================== | | | | --- | --- |Exceptions summary | [APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) | Exception class for API missing file / bad permissions | | [APIAuthTokenException](https://api.legiscan.com/docs/class-APIAuthTokenException.html) | Exception class for API authorization token errors | | [APIException](https://api.legiscan.com/docs/class-APIException.html) | Exception class for API general errors | | [APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) | Exception class for API status errors | --- # Package LegiScan\Common | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Package [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\Common ================================================================================ | | | | --- | --- |Functions summary | [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) | Check to see if the current user is the expected user | | [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) | Simple check to see if script running via the CLI SAPI | | [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) | Wrapper around getopt() that also strips recognized options from $argv | | [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) | Print some help text for command line options and exit() | | [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) | Check to see if an option is set and return the value if it had an argument, otherwise true/false | | [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) | Get the current and peak memory usage as a string for logging | | [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) | Given a compact JSON string return a pretty printed version | | [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) | Convert elapsed seconds to H:M:S format | | [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) | Clear and reset a named timer | | [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) | Read a named timer value without stopping it | | [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) | Start a named timer, if a timer is started and stopped multiple times, the intervals will be accumulated | | [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) | Stop a named timer and return the timer values | | [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) | Ask for a Yes/No response if on terminal, otherwise return default answer | --- # Package LegiScan\Utility | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Package [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\Utility ================================================================================= | | | | --- | --- |Classes summary | [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) | A generic holder for some core static functions | | [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) | A command line utility for pulls and system internals | | [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) | A push endpoint server for LegiScan Push API subscriptions | | [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) | A bulk loader for JSON datasets and snapshots | | [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) | A web interface for testing the LegiScan Pull API class | | [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) | A daemon process that will import and keep bills up to date | --- # Class LegiScan | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan ============== A generic holder for some core static functions Non-inherited class primarily for static calls to pull configuration values, write log messages, send mail alerts and hold constants. You will likely find `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` and `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` of much greater interest. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Link:** [https://legiscan.com/legiscan](https://legiscan.com/legiscan) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-LegiScan.html#43-264 "Go to source code") | | | | --- | --- |Methods summary | `public static mixed` | [#](https://api.legiscan.com/docs/class-LegiScan.html#_getConfig)
`[getConfig](https://api.legiscan.com/docs/source-class-LegiScan.html#115-154 "Go to source code") ( string\|null $key = null, mixed\|null $default = null )`

Get the configuation array or a specific key from it

Get the configuation array or a specific key from it

#### Parameters

$key

(**OPTIONAL**) Return `$key` from config array

$default

(**OPTIONAL**) If `$key` does not exist return `$default`

#### Returns

mixed
Either the configuration array or a specific `$key` value | | `public static` | [#](https://api.legiscan.com/docs/class-LegiScan.html#_fileLog)
`[fileLog](https://api.legiscan.com/docs/source-class-LegiScan.html#158-198 "Go to source code") ( string $msg, string $file = null )`

Write log message to file located at {log\_dir}/legiscan.log

Write log message to file located at {log\_dir}/legiscan.log

#### Parameters

$msg

The log message to be written

$file

(**OPTIONAL**) If specified write log to {log\_dir}/$file

#### Throws

`[APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) ` | | `public static` | [#](https://api.legiscan.com/docs/class-LegiScan.html#_sendMail)
`[sendMail](https://api.legiscan.com/docs/source-class-LegiScan.html#202-250 "Go to source code") ( string $subject, string $body )`

Send an email to the address specified in config.php, throttled to 1 msg/5 min (overflow sent to fileLog)

Send an email to the address specified in config.php, throttled to 1 msg/5 min (overflow sent to fileLog)

#### Parameters

$subject

The email subject

$body

The email body | | `public static string` | [#](https://api.legiscan.com/docs/class-LegiScan.html#_getVersion)
`[getVersion](https://api.legiscan.com/docs/source-class-LegiScan.html#254-262 "Go to source code") ( )`

Get the LegiScan version number

Get the LegiScan version number

#### Returns

string
Version number | | | | | | --- | --- | --- |Constants summary | `string` | `[**VERSION**](https://api.legiscan.com/docs/source-class-LegiScan.html#58-61 "Go to source code") `

Version number of the LegiScan API Client

Version number of the LegiScan API Client | [#](https://api.legiscan.com/docs/class-LegiScan.html#VERSION)
`'1.4.1'` | | `integer` | `[**SCHEMA_VERSION**](https://api.legiscan.com/docs/source-class-LegiScan.html#63-66 "Go to source code") `

Version number of the LegiScan API database schema

Version number of the LegiScan API database schema | [#](https://api.legiscan.com/docs/class-LegiScan.html#SCHEMA_VERSION)
`9` | | `string` | `[**API_OK**](https://api.legiscan.com/docs/source-class-LegiScan.html#68-71 "Go to source code") `

Response string for a successful response

Response string for a successful response | [#](https://api.legiscan.com/docs/class-LegiScan.html#API_OK)
`'OK'` | | `string` | `[**API_ERROR**](https://api.legiscan.com/docs/source-class-LegiScan.html#73-76 "Go to source code") `

Response string for a failure response

Response string for a failure response | [#](https://api.legiscan.com/docs/class-LegiScan.html#API_ERROR)
`'ERROR'` | | `integer` | `[**IMPORT_NONE**](https://api.legiscan.com/docs/source-class-LegiScan.html#78-81 "Go to source code") `

MasterList/Search import control, do nothing

MasterList/Search import control, do nothing | [#](https://api.legiscan.com/docs/class-LegiScan.html#IMPORT_NONE)
`0` | | `integer` | `[**IMPORT_NEW**](https://api.legiscan.com/docs/source-class-LegiScan.html#83-86 "Go to source code") `

MasterList/Search import control, only new bills

MasterList/Search import control, only new bills | [#](https://api.legiscan.com/docs/class-LegiScan.html#IMPORT_NEW)
`1` | | `integer` | `[**IMPORT_CHANGED**](https://api.legiscan.com/docs/source-class-LegiScan.html#88-91 "Go to source code") `

MasterList/Search import control, only changed bills

MasterList/Search import control, only changed bills | [#](https://api.legiscan.com/docs/class-LegiScan.html#IMPORT_CHANGED)
`2` | | `integer` | `[**IMPORT_ALL**](https://api.legiscan.com/docs/source-class-LegiScan.html#93-96 "Go to source code") `

MasterList/Search import control, all bills

MasterList/Search import control, all bills | [#](https://api.legiscan.com/docs/class-LegiScan.html#IMPORT_ALL)
`3` | | `integer` | `[**STANCE_WATCH**](https://api.legiscan.com/docs/source-class-LegiScan.html#98-101 "Go to source code") `

setMonitor stance, watch bill

setMonitor stance, watch bill | [#](https://api.legiscan.com/docs/class-LegiScan.html#STANCE_WATCH)
`0` | | `integer` | `[**STANCE_SUPPORT**](https://api.legiscan.com/docs/source-class-LegiScan.html#103-106 "Go to source code") `

setMonitor stance, support bill

setMonitor stance, support bill | [#](https://api.legiscan.com/docs/class-LegiScan.html#STANCE_SUPPORT)
`1` | | `integer` | `[**STANCE_OPPOSE**](https://api.legiscan.com/docs/source-class-LegiScan.html#108-111 "Go to source code") `

setMonitor stance, oppose bill

setMonitor stance, oppose bill | [#](https://api.legiscan.com/docs/class-LegiScan.html#STANCE_OPPOSE)
`2` | --- # Package PHP | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [PDO](https://api.legiscan.com/docs/class-PDO.html) * [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ### Interfaces * [Traversable](https://api.legiscan.com/docs/class-Traversable.html) ### Exceptions * [Exception](https://api.legiscan.com/docs/class-Exception.html) * [PDOException](https://api.legiscan.com/docs/class-PDOException.html) * [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Package PHP =========== | | | | --- | --- |Classes summary | [PDO](https://api.legiscan.com/docs/class-PDO.html) | | | [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) | | | | | | --- | --- |Interfaces summary | [Traversable](https://api.legiscan.com/docs/class-Traversable.html) | | | | | | --- | --- |Exceptions summary | [Exception](https://api.legiscan.com/docs/class-Exception.html) | | | [PDOException](https://api.legiscan.com/docs/class-PDOException.html) | | | [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) | | --- # Class LegiScan_Bulk | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) * [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) * [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) * [LegiScan\_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Bulk ==================== LegiScan API Bulk Dataset Class Worker class that processes a LegiScan dataset archive and imports / updates the local database, passing the individual JSON payloads to their corresponding handlers in `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) `. Used by `[LegiScan_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) ` in the `legiscan-bulk.php` utility. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[API](https://api.legiscan.com/docs/package-LegiScan.API.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) ` **See:** `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Link:** [https://legiscan.com/datasets](https://legiscan.com/datasets) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-LegiScan_Bulk.html#1781-1975 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Bulk.html#___construct)
`[__construct](https://api.legiscan.com/docs/source-class-LegiScan_Bulk.html#1808-1815 "Go to source code") ( )`

Class constructor, initilizes necessary `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` instances

Class constructor, initilizes necessary `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` instances | | `public mixed[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Bulk.html#_importDataset)
`[importDataset](https://api.legiscan.com/docs/source-class-LegiScan_Bulk.html#1819-1973 "Go to source code") ( string $zipfile, mixed[] $params )`

Process LegiScan session dataset ZIP archive and import into database `[LegiScan_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) `

Process LegiScan session dataset ZIP archive and import into database `[LegiScan_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) `

#### Parameters

$zipfile

Path to a zip archive from LegiScan datasets or subscriber snapshot

$params

Additional parameters to control behavior and output

#### Returns

mixed\[\]
Array with hash and counts for the number of objects imported | | | | | | --- | --- | --- |Properties summary | `` protected `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` `` | [$logic](https://api.legiscan.com/docs/source-class-LegiScan_Bulk.html#1799-1804 "Go to source code")

Instance of `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) `

Instance of `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` | [#](https://api.legiscan.com/docs/class-LegiScan_Bulk.html#$logic) | --- # Class LegiScan_Cache_File | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Cache\_File](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html) * [LegiScan\_Cache\_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Cache\_File =========================== LegiScan API File Cache Class Basic file caching with expirations to cache API responses and build permanent local bill text / document storage. To generate the path fragment under each respective cache directories use LegiScan\_Pull::getCacheFilename() or LegiScan\_Process::getCacheFilename(). API cache --------- As a dynamic API cache this stores pull API requests and search results in a local directory structure if there are no errors and subsequent calls to the same API hook will replay. Directory structure where `{api_dir}` is from `LegiScan::getConfig('api_dir')` * `{api_dir}/amendment/AMENDMENT_ID.json` * `{api_dir}/bill/BILL_ID.json` * `{api_dir}/masterlist/SESSION_ID.json` * `{api_dir}/people/PEOPLE_ID.json` * `{api_dir}/rollcall/ROLL_CALL_ID.json` * `{api_dir}/search/SEARCH_GUID.json` * `{api_dir}/sessionlist/STATE.json` * `{api_dir}/supplement/SUPPLEMENT_ID.json` * `{api_dir}/text/TEXT_ID.json` Document cache -------------- As a static document cache this is the basis for local storage of related documents (bill texts, amendments, supplements) as a well structured archive that can be easily accessed by humans and automation. Directory structure `TYPE/STATE/SESSION_ID/BILL_NUMBER/ID/MIME_EXT` where `{doc_dir}` is from `LegiScan::getConfig('doc_dir')` * `{doc_dir}/amendment/tx/1478/hb1/3928402/pdf` * `{doc_dir}/supplement/md/1412/sb493/56768/pdf` * `{doc_dir}/text/ca/1400/sb1/1439083/html` **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** LegiScan\_Pull::getCacheFilename **See:** LegiScan\_Process::getCacheFilename **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#268-541 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#___construct)
`[__construct](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#347-380 "Go to source code") ( string $type, integer $lifetime = self::LIFETIME )`

Class constructor

Class constructor

#### Parameters

$type

Type of cache {api, doc}

$lifetime

Time in seconds for api cache lifetime

#### Throws

`[APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) ` | | `public mixed` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#_get)
`[get](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#384-420 "Go to source code") ( string $file, integer $lifetime = null )`

Get an entry from the cache, if operating as API cache also enfore expiration lifetime, otherwise treat as a permanent document archive

Get an entry from the cache, if operating as API cache also enfore expiration lifetime, otherwise treat as a permanent document archive

#### Parameters

$file

$cache\_file File location to retrieve, this may include additional directories under _cache\_dir_

$lifetime

Max age in seconds that a cached file is valid

#### Returns

mixed
The contents of the cache location or FALSE for missing/stale | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#_set)
`[set](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#424-456 "Go to source code") ( string $file, string $data )`

Put an entry into the cache, creating any nested directories as required

Put an entry into the cache, creating any nested directories as required

#### Parameters

$file

File location to store, this may include additional directories under _cache\_dir_

$data

Data to store in cache location

#### Returns

boolean
Indicating the success/failure of storing the data

#### Throws

`[APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#_clean)
`[clean](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#460-539 "Go to source code") ( $verbose = false )`

Clean the API cache of stale entries

Clean the API cache of stale entries

#### Returns

boolean
Indicating the success/failure of the cleanup

#### Throws

`[APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) ` | | | | | | --- | --- | --- |Constants summary | `integer` | `[**TYPE_API**](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#317-320 "Go to source code") `

Type - API (expiration)

Type - API (expiration) | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#TYPE_API)
`1` | | `integer` | `[**TYPE_DOC**](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#321-324 "Go to source code") `

Type - Document (permanent)

Type - Document (permanent) | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#TYPE_DOC)
`2` | | `integer` | `[**LIFETIME**](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#325-328 "Go to source code") `

Default lifetime of API cache objects in seconds (60 minutes)

Default lifetime of API cache objects in seconds (60 minutes) | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#LIFETIME)
`3600` | | | | | | --- | --- | --- |Properties summary | `private` | [$lifetime](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#332-335 "Go to source code")

Lifetime of API cache objects

Lifetime of API cache objects | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#$lifetime) | | `private` | [$cache\_type](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#336-339 "Go to source code")

Type of cache

Type of cache | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#$cache_type) | | `private` | [$cache\_dir](https://api.legiscan.com/docs/source-class-LegiScan_Cache_File.html#340-343 "Go to source code")

Base directory for cached files

Base directory for cached files | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html#$cache_dir) | --- # Class LegiScan_Cache_Memory | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Cache\_File](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html) * [LegiScan\_Cache\_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Cache\_Memory ============================= LegiScan API Memory Cache Class Basic singleton memory cache that offers a simple non-stateful memory cache or interfaces with an external memcache server, either via Memcache or Memcached. Underutilized in this application, it currently caches simple `exists(ID)` style lookups. Internally at LegiScan this saves 100-125 qps in production, though in this isolated API Client implementation will be around 5-10 qps. $memcache = LegiScan\_Cache\_Memory::getInstance(); $key = "key-sample-1"; $memcache\->set($key, 12345); $value = $memcache\->get($key); var\_dup($value); **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** LegiScan\_Process::checkExists **Link:** [https://memcached.org/](https://memcached.org/) **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#545-724 "Go to source code") | | | | --- | --- |Methods summary | `private` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#___construct)
`[__construct](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#600-611 "Go to source code") ( integer $lifetime )`

This is not the contructor you are looking for... Static Singleton

This is not the contructor you are looking for... Static Singleton

#### Parameters

$lifetime

Time in seconds for api cache lifetime | | `public static` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#_getInstance)
`[getInstance](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#615-659 "Go to source code") ( integer $lifetime = self::LIFETIME )`

Get a instance of either internal memory cache or external memcached

Get a instance of either internal memory cache or external memcached

#### Parameters

$lifetime

Lifetime of a cached value | | `public mixed` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#_get)
`[get](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#663-682 "Go to source code") ( string $key )`

Get an entry from the cache

Get an entry from the cache

#### Parameters

$key

Cache key to retrieve

#### Returns

mixed
The contents of the file or FALSE for missing/stale | | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#_set)
`[set](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#686-706 "Go to source code") ( string $key, string $data, string $lifetime = self::LIFETIME )`

Store an entry in the cache

Store an entry in the cache

#### Parameters

$key

Cache key value

$data

Data to store under cache key

$lifetime

How long until the data expires, in seconds | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#_flush)
`[flush](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#710-722 "Go to source code") ( )`

Clear all items from cache

Clear all items from cache

#### Returns

boolean
Indicating the success/failure of the cleanup | | | | | | --- | --- | --- |Constants summary | `integer` | `[**LIFETIME**](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#575-578 "Go to source code") `

Default lifetime of API cache objects in seconds (60 minutes)

Default lifetime of API cache objects in seconds (60 minutes) | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#LIFETIME)
`3600` | | | | | | --- | --- | --- |Properties summary | `private static integer` | [$lifetime](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#582-586 "Go to source code")

Lifetime of cache objects

Lifetime of cache objects | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#$lifetime) | | `private static array` | [$cache](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#587-591 "Go to source code")

Our cache array if no memcached server

Our cache array if no memcached server | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#$cache) | | `private static object` | [$instance](https://api.legiscan.com/docs/source-class-LegiScan_Cache_Memory.html#592-596 "Go to source code")

Singleton class instance

Singleton class instance | [#](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html#$instance) | --- # Class LegiScan_Push | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) * [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) * [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) * [LegiScan\_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Push ==================== LegiScan API Push Interface Class Framework to process and decode incoming payloads as the endpoint listener in a Push API interface. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[API](https://api.legiscan.com/docs/package-LegiScan.API.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) ` **See:** `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Link:** [https://legiscan.com/legiscan](https://legiscan.com/legiscan) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#728-914 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#___construct)
`[__construct](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#767-774 "Go to source code") ( )`

Class constructor

Class constructor | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#_processPush)
`[processPush](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#778-828 "Go to source code") ( )`

Processes an incoming LegiScan API JSON payload into an associative array

Processes an incoming LegiScan API JSON payload into an associative array

#### Returns

boolean
Success of payload processing

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) ` | | `public mixed[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#_getPayload)
`[getPayload](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#832-842 "Go to source code") ( )`

Returns the decoded payload associative array for the most recently processed record

Returns the decoded payload associative array for the most recently processed record

#### Returns

mixed\[\]
The decoded payload array | | `public string` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#_getPayloadType)
`[getPayloadType](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#846-855 "Go to source code") ( )`

Returns the type of payload that was most recently processed

Returns the type of payload that was most recently processed

#### Returns

string
The type of payload `[bill, text, amendment, supplement, roll_call, person, session]` | | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#_respondOk)
`[respondOk](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#859-872 "Go to source code") ( array $missing = array() )`

Wrapper function around respond() that creates a valid OK response

Wrapper function around respond() that creates a valid OK response

#### Parameters

$missing

Optional array listing missing objects to request in the response | | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#_respondError)
`[respondError](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#876-892 "Go to source code") ( string $error_message )`

Wrapper function around respond() that creates a valid ERROR response

Wrapper function around respond() that creates a valid ERROR response

#### Parameters

$error\_message

A descriptive user-defined error message to explain the error response | | `private` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#_respond)
`[respond](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#896-912 "Go to source code") ( array $response )`

Encode and send a valid API response back to LegiScan

Encode and send a valid API response back to LegiScan

#### Parameters

$response

Contains the push endpoint server response structure | | | | | | --- | --- | --- |Properties summary | `protected array` | [$payload](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#744-749 "Go to source code")

The decoded payload that was last processed through `[LegiScan_Push::processPush()](https://api.legiscan.com/docs/class-LegiScan_Push.html#_processPush) `

The decoded payload that was last processed through `[LegiScan_Push::processPush()](https://api.legiscan.com/docs/class-LegiScan_Push.html#_processPush) ` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#$payload) | | `protected string` | [$payload\_type](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#751-756 "Go to source code")

The type of payload that was last processed through `[LegiScan_Push::processPush()](https://api.legiscan.com/docs/class-LegiScan_Push.html#_processPush) `

The type of payload that was last processed through `[LegiScan_Push::processPush()](https://api.legiscan.com/docs/class-LegiScan_Push.html#_processPush) ` | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#$payload_type) | | `protected string` | [$form\_var](https://api.legiscan.com/docs/source-class-LegiScan_Push.html#758-763 "Go to source code")

Form variable name in the case of cooked x-www-form-urlencoded payload

Form variable name in the case of cooked x-www-form-urlencoded payload | [#](https://api.legiscan.com/docs/class-LegiScan_Push.html#$form_var) | --- # Class LegiScan_CommandLine | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_CommandLine =========================== A command line utility for pulls and system internals The CLI interface allow for importing specific objects from the command line along with manipulating some internal controls. This could be used for testing purposes or for automation with other custom scripting. Show the command help php legiscan-cli.php --help Import the current GAITS monitoring list associated with the API key and sync with the local `ls_monitor` list php legiscan-cli.php --monitorlist --import all --sync Get the master list for the most recent session in California, but do not actually import and dump the response payload php legiscan-cli.php --dry-run --debug --masterlist CA Request a specific `bill_id` php legiscan-cli.php --bill 823201 Run a national search and import new bills with a relevance score of 75% or higher php legiscan-cli.php --search "citizens ADJ united" --state ALL --import new --score 75 Add several `bill_id` to the monitor list with support stance and synchronize with GAITS php legiscan-cli.php --monitor 843038,908829,817390 --stance support --sync Add a `bill_id` to the ignore list php legiscan-cli.php --ignore 898381 Clean the API cache of stale entries php legiscan-cli.php --clean --verbose **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` **See:** `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Located at** [legiscan-cli.php](https://api.legiscan.com/docs/source-class-LegiScan_CommandLine.html#21-443 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html#_commands)
`[commands](https://api.legiscan.com/docs/source-class-LegiScan_CommandLine.html#70-441 "Go to source code") ( )`

Make appropriate API calls and processes results into the database

Make appropriate API calls and processes results into the database | --- # Class LegiScan_Endpoint | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Endpoint ======================== A push endpoint server for LegiScan Push API subscriptions The `legiscan-push.php` script serves as the endpoint listener for LegiScan Push API services. This will receive payloads from the LegiScan Push server and process them into the provided database. The LegiScan API Client should be installed in a location that is accessible by your web server and externally by LegiScan servers. For additional authentication you may also set `api_auth_key` which can be found / updated from the LegiScan API control panel at [legiscan.com](https://legiscan.com/legiscan) . This will validate against the HTTP Authorization header sent with incoming payloads and reject those with invalid tokens. If your API key is set to receive cooked application/x-www-form-urlencoded payloads, be sure to change the `push_form_var` setting to the form variable name specified in the API control panel. **NOTE**: To utilize this script you will need a Push API subscription. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` **See:** `[LegiScan_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Located at** [legiscan-push.php](https://api.legiscan.com/docs/source-class-LegiScan_Endpoint.html#21-174 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html#_process)
`[process](https://api.legiscan.com/docs/source-class-LegiScan_Endpoint.html#50-172 "Go to source code") ( )`

Endpoint listener for LegiScan API Push subscriptions to process an incoming push payload to the database.

Endpoint listener for LegiScan API Push subscriptions to process an incoming push payload to the database. | --- # Class LegiScan_WebTest | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_WebTest ======================= A web interface for testing the LegiScan Pull API class The web interface is primarily for demonstration purposes to generate single API requests to examine payload structure. The LegiScan API client and `legiscan-ui.php` should be accessible by your web server. Then point your brower to the URL of interface script http://example.com/legiscan/legiscan-ui.php Enter your API key in the space provided, select the type of payload request you would like and enter the appropriate ID, then click `Run Test`. The system will then output the URL used to generate the request, the raw JSON response and decoded payload data structure. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Located at** [legiscan-ui.php](https://api.legiscan.com/docs/source-class-LegiScan_WebTest.html#21-168 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_WebTest.html#_processPOST)
`[processPOST](https://api.legiscan.com/docs/source-class-LegiScan_WebTest.html#44-166 "Go to source code") ( )`

Web based demo to provide a form to generate a Pull API call and dump the results

Web based demo to provide a form to generate a Pull API call and dump the results | --- # Class LegiScan_Worker | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Worker ====================== A daemon process that will import and keep bills up to date The `legiscand.php` script provides a daemon process that can use four different methods, controlled by the `update_type` setting, to keep a local database synchronized via LegiScan Pull API. Monitor ------- This mode will use the `ls_monitor` table to keep a specific `bill_id` list updated. This list can be managed with `legiscan-cli.php`, though determining the `bill_id` is an exercise for the reader and would require additional scripting, though a likely source would be through the search engine. php legiscan-cli.php --monitor 823882 php legiscan-cli.php --unmonitor 823882 State ----- This mode will synchronize the entire master list from one or more states. To set the state list edit `config.php` and add each state to the `states[]` setting. For example to track all legislation in California and US Congress: states\[\] = CA states\[\] = US **NOTE**: It is _HIGHLY_ recommended pre-loading the current state [datasets](https://api.legiscan.com/dl) with `legiscan-bulk.php` prior to the first run to minimize the on-boarding queries. Search (National) ----------------- This mode will synchronize the results of searches ran against the national database. To specify the searches edit the `config.php` and add each search to the `searches[]` setting. The searches will also be filtered by the global `relevance` cutoff setting, which can be overridden on a per search basis by prepending a different score and the pipe `|` character. In addition a `state` abbreviations can also be prefixed to override either national or state search. When used with a `relevance` override the `state` should appear first separated by a comma `,`. Also notice that the entire search string should be quoted, and any internal quotes should be escaped as `\"`. searches\[\] = "gender AND bathroom" searches\[\] = "\\"national popular vote\\"" searches\[\] = "42|hemp OR cannabis OR marijuana" searches\[\] = "NY|charter ADJ schools" searches\[\] = "CA,60|vaccination AND status:passed" State Search ------------ This mode combines both of the other methods such that the `searches[]` are only ran against the `states[]` list, unless a search specific `state` is used. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` **See:** `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Located at** [legiscand.php](https://api.legiscan.com/docs/source-class-LegiScan_Worker.html#21-409 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Worker.html#_worker)
`[worker](https://api.legiscan.com/docs/source-class-LegiScan_Worker.html#91-408 "Go to source code") ( integer $daemon )`

Worker loop that generates a bill\_id list then imports / updates via LegiScan\_Pull::importBillList

Worker loop that generates a bill\_id list then imports / updates via LegiScan\_Pull::importBillList

#### Parameters

$daemon

If non-zero the worker will loop forever | --- # Class LegiScan_Pull | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) * [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) * [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) * [LegiScan\_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Pull ==================== LegiScan API Pull Interface Class Basic pull class to generate API requests and decode the JSON responses. Doing something interesting with the results is the job of `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) `. Each `get*()` function maps to the corresponding API operation, preparing the request array and processing through LegiScan\_Pull::apiRequest(). **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[API](https://api.legiscan.com/docs/package-LegiScan.API.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) ` **See:** `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` **See:** `[LegiScan_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Link:** [https://legiscan.com/legiscan](https://legiscan.com/legiscan) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#918-1777 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#___construct)
`[__construct](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#981-999 "Go to source code") ( string $api_key,… )`

Class constructor that nominally validates the API key

Class constructor that nominally validates the API key

#### Parameters

$api\_key,…

(**OPTIONAL**) Override the api\_key from LegiScan::getConfig()

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) ` | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getSessionList)
`[getSessionList](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1003-1017 "Go to source code") ( string $state )`

Get a session list for a specified state

Get a session list for a specified state

#### Parameters

$state

State to pull the session list for

#### Returns

array
The list of state sessions and their corresponding session\_id numbers | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getMasterList)
`[getMasterList](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1021-1040 "Go to source code") ( integer $session_id )`

Get a master list of bills for a specific session\_id

Get a master list of bills for a specific session\_id

#### Parameters

$session\_id

LegiScan session\_id to pull the master list for

#### Returns

array
The master list of current bills with their corresponding bill\_id numbers | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getMasterListRaw)
`[getMasterListRaw](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1044-1064 "Go to source code") ( integer $session_id )`

Get a master list of bills for a specific session\_id optimized for `change_hash` detection

Get a master list of bills for a specific session\_id optimized for `change_hash` detection

#### Parameters

$session\_id

LegiScan session\_id to pull the master list for

#### Returns

array
The master list of current bills with their corresponding bill\_id numbers | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getBill)
`[getBill](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1068-1082 "Go to source code") ( integer $bill_id )`

Get the bill detail record for a specified bill

Get the bill detail record for a specified bill

#### Parameters

$bill\_id

The internal bill id for the requested bill

#### Returns

array
The record containing a summary of the bill detail information | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getBillText)
`[getBillText](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1086-1105 "Go to source code") ( integer $text_id )`

Get a copy of the bill text for the specified document id

Get a copy of the bill text for the specified document id

(**Note**: doc is base64 encoded)

#### Parameters

$text\_id

The internal bill id for the requested bill text

#### Returns

array
The bill text record with the actual text and meta type information | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getAmendment)
`[getAmendment](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1109-1128 "Go to source code") ( integer $amendment_id )`

Get a copy of the bill amendment for the specified amendment id

Get a copy of the bill amendment for the specified amendment id

(**Note**: doc is base64 encoded)

#### Parameters

$amendment\_id

The internal amendment id for the requested bill amendment

#### Returns

array
The bill amendment record with the actual amendment and meta type information | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getSupplement)
`[getSupplement](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1132-1151 "Go to source code") ( integer $supplement_id )`

Get a copy of the bill supplement for the specified supplement id

Get a copy of the bill supplement for the specified supplement id

(**Note**: doc is base64 encoded)

#### Parameters

$supplement\_id

The internal supplement id for the requested bill supplement

#### Returns

array
The bill supplement record with the actual supplement and meta type information | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getRollCall)
`[getRollCall](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1155-1170 "Go to source code") ( integer $roll_call_id )`

Get the roll call record for a specified bill with vote summary and individual legislator vote information

Get the roll call record for a specified bill with vote summary and individual legislator vote information

#### Parameters

$roll\_call\_id

The internal LegiScan roll\_call\_id for the requested vote

#### Returns

array
A detailed roll call record with individual vote data | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getPerson)
`[getPerson](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1174-1188 "Go to source code") ( integer $people_id )`

Get a basic people record for the specified id

Get a basic people record for the specified id

#### Parameters

$people\_id

The internal LegiScan people\_id to be retrieved `[LegiScan_Pull::apiRequest()](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_apiRequest) `

#### Returns

array
The basic sponsor information for the given people\_id | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getSearch)
`[getSearch](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1192-1233 "Go to source code") ( array $search )`

Performs a search against the LegiScan national legislative database

Performs a search against the LegiScan national legislative database

#### Parameters

$search

An associative array with the search parameters: `state`, `bill`, `query`, `year`

#### Returns

array
A page of search results for the given query parameters

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) ` | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getSearchRaw)
`[getSearchRaw](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1237-1275 "Go to source code") ( array $search )`

Performs a raw search against the LegiScan national legislative database

Performs a raw search against the LegiScan national legislative database

#### Parameters

$search

An associative array with the search parameters: `state`, `bill`, `query`, `year`

#### Returns

array
A page of search results for the given query parameters

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) ` | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getDatasetList)
`[getDatasetList](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1279-1297 "Go to source code") ( array $filter )`

Get a list of available datasets with optional filters

Get a list of available datasets with optional filters

#### Parameters

$filter

Optional state and year filters

#### Returns

array
The list of datasets available and their corresponding access keys | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getDataset)
`[getDataset](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1301-1318 "Go to source code") ( integer $session_id, string $access_key )`

Get a dataset archive payload for a specific session id

Get a dataset archive payload for a specific session id

#### Parameters

$session\_id

The internal LegiScan session\_id to be retrieved

$access\_key

A valid access key provided in getDatasetList

#### Returns

array
The dataset payload with the actual zip file and meta information | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getSessionPeople)
`[getSessionPeople](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1322-1336 "Go to source code") ( integer $session_id )`

Retrieve a list of people records active in a specific session id

Retrieve a list of people records active in a specific session id

#### Parameters

$session\_id

The internal LegiScan session\_id to scan

#### Returns

array
Collection of `[LegiScan_Pull::getPerson()](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getPerson) ` equivalent records of those active in session | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getSponsoredList)
`[getSponsoredList](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1340-1354 "Go to source code") ( integer $people_id )`

Retrieve a list of bills sponsored by an individual legislator

Retrieve a list of bills sponsored by an individual legislator

#### Parameters

$people\_id

$people The internal LegiScan people\_id to look for

#### Returns

array
Information on the list of sponsored bills | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getMonitorList)
`[getMonitorList](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1358-1377 "Go to source code") ( array $filter )`

Retrieve a list of bills monitored in the GAITS account associated with the API key

Retrieve a list of bills monitored in the GAITS account associated with the API key

#### Parameters

$filter

An associative array with the filter parameters: `record`

#### Returns

array
Information on the list of monitored bills | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getMonitorListRaw)
`[getMonitorListRaw](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1381-1400 "Go to source code") ( array $filter )`

Retrieve a list of bills monitored in the associated GAITS account, optimized for `change_hash` detection

Retrieve a list of bills monitored in the associated GAITS account, optimized for `change_hash` detection

#### Parameters

$filter

An associative array with the filter parameters: `record`

#### Returns

array
Information on the list of monitored bills | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_setMonitor)
`[setMonitor](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1404-1429 "Go to source code") ( array $monitor )`

Set the monitoring status of one or more `bill_id` in the GAITS account monitoring or ignore list

Set the monitoring status of one or more `bill_id` in the GAITS account monitoring or ignore list

#### Parameters

$monitor

An associative array with the monitor parameters: `action` - action to take: monitor, ignore, remove `list` - bill\_id list to operate on `stance` - position on bill: watch, support, oppose

#### Returns

array
Information on the list of monitored bills | | `protected mixed[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_apiRequest)
`[apiRequest](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1433-1529 "Go to source code") ( string $op, array $params )`

Makes the actual request to the LegiScan API server via cURL

Makes the actual request to the LegiScan API server via cURL

#### Parameters

$op

The API operation to actually perform

$params

An associative array of the required parameters to perform the needed API operation

#### Returns

mixed\[\]
An associative array representing the API response

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_importBillList)
``[importBillList](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1533-1627 "Go to source code") ( array $bills, `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` $logic )``

Process a bill\_id list processing and requesting any necessary missing child objects

Process a bill\_id list processing and requesting any necessary missing child objects

#### Parameters

$bills

$payload List of the LegiScan bill\_ids that should be imported

$logic

An instance of `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` attached to its database

#### Returns

boolean
Indicating the success/failure of bill payload processing | | `public string` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getURL)
`[getURL](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1631-1640 "Go to source code") ( )`

Return the most recent Pull API request URL generated by `[LegiScan_Pull::apiRequest()](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_apiRequest) `

Return the most recent Pull API request URL generated by `[LegiScan_Pull::apiRequest()](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_apiRequest) `

#### Returns

string
The full request URL | | `public string` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getRawResponse)
`[getRawResponse](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1644-1653 "Go to source code") ( )`

Return the JSON payload of the most recent Pull API request by `[LegiScan_Pull::apiRequest()](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_apiRequest) `

Return the JSON payload of the most recent Pull API request by `[LegiScan_Pull::apiRequest()](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_apiRequest) `

#### Returns

string
The JSON data structure | | `public string` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#_getCacheFilename)
`[getCacheFilename](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#1657-1775 "Go to source code") ( string $op, array $params )`

Generate an API cache filename

Generate an API cache filename

#### Parameters

$op

The API operation hook name

$params

The API paramaters that were part of the call

#### Returns

string
Filename path fragment for the cache location under cache root | | | | | | --- | --- | --- |Properties summary | `protected string` | [$api\_key](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#938-944 "Go to source code")

LegiScan API key for requests from `config.php`

LegiScan API key for requests from `config.php` | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#$api_key) | | `protected string` | [$response](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#946-952 "Go to source code")

Raw response from an API call

Raw response from an API call | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#$response) | | `protected mixed[]` | [$payload](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#954-960 "Go to source code")

Decoded associative array representing the API response

Decoded associative array representing the API response | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#$payload) | | `` protected `[LegiScan_Cache_File](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html) ` `` | [$cache](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#962-968 "Go to source code")

Cache layer interface

Cache layer interface | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#$cache) | | `protected string` | [$request\_url](https://api.legiscan.com/docs/source-class-LegiScan_Pull.html#970-976 "Go to source code")

Most recent Pull API request URL

Most recent Pull API request URL | [#](https://api.legiscan.com/docs/class-LegiScan_Pull.html#$request_url) | --- # Class LegiScan_Import | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan](https://api.legiscan.com/docs/class-LegiScan.html) * [LegiScan\_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) * [LegiScan\_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) * [LegiScan\_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) * [LegiScan\_WebTest](https://api.legiscan.com/docs/class-LegiScan_WebTest.html) * [LegiScan\_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Import ====================== A bulk loader for JSON datasets and snapshots Starting here is **STRONGLY** encouraged as a few hundred files are the equivalent of approximately **2 million** individual API calls. Using the getDataset API hooks, a manually downloaded copy of a weekly [Public Dataset](https://legiscan.com/datasets) , or a custom subscriber onboarding snapshot, this script will extract the contents of the archives and import/update data as needed. When using getDataset, the script can operate in two modes, `--scan` and `--bulk`, both of which import new and updated datasets. The `--scan` mode acts like a interactive search / browser with command line filters to import eligible datasets. While in `--bulk` mode, the `states[]` and `years[]` variables in `config.php` will be used to select which datasets will be synchronized. The latter of which is most appropriate for scheduling for automating updates. Show the command help php legiscan-bulk.php --help Use `config.php` settings to import datasets and answer yes to any prompts. php legiscan-bulk.php --bulk --import --yes Show a listing of all available datasets in California php legiscan-bulk.php --scan --state CA Import all new/changed datasets in 2020 with verbose output php legiscan-bulk.php --scan --year 2020 --import --verbose Import all new/changed 2016 special sessions in North Carolina php legiscan-bulk.php --scan --state NC --special --year 2016 --import Process `example.zip` but do not import, only show what would have been done php legiscan-bulk.php --file example.zip --dry-run --debug **NOTE**: This will not pull local copies of documents unless they are included in the archive, though appropriate stub records will be created. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` **See:** `[LegiScan_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Link:** [https://legiscan.com/datasets](https://legiscan.com/datasets) **Located at** [legiscan-bulk.php](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#22-567 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#___construct)
`[__construct](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#105-118 "Go to source code") ( )`

Class constructor, initilizes necessary API instances

Class constructor, initilizes necessary API instances | | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#_updateDatasets)
`[updateDatasets](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#122-294 "Go to source code") ( )`

Use the `states[]` and `years[]` settings in `config.php` to find eligible datasets from LegiScan\_Pull::getDatasetList to pull and import to the local database

Use the `states[]` and `years[]` settings in `config.php` to find eligible datasets from LegiScan\_Pull::getDatasetList to pull and import to the local database

#### See

`[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` | | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#_scanDatasets)
`[scanDatasets](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#298-458 "Go to source code") ( )`

Use LegiScan\_Pull::getDatasetList to generate listings of available datasets with optional filtering and import new or updated archives

Use LegiScan\_Pull::getDatasetList to generate listings of available datasets with optional filtering and import new or updated archives

#### See

`[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` | | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#_processFile)
`[processFile](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#462-503 "Go to source code") ( )`

Process a single LegiScan session dataset or subscriber onboarding ZIP archive that was previously manually downloaded from the public or private site with LegiScan\_Bulk::importDataset

Process a single LegiScan session dataset or subscriber onboarding ZIP archive that was previously manually downloaded from the public or private site with LegiScan\_Bulk::importDataset

#### See

`[LegiScan_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) `

#### Link

[https://legiscan.com/datasets](https://legiscan.com/datasets) | | `private` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#_processDownloads)
`[processDownloads](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#507-565 "Go to source code") ( mixed[] $downloads )`

Take array of eligible `dataset` objects from `[LegiScan_Import::scanDatasets()](https://api.legiscan.com/docs/class-LegiScan_Import.html#_scanDatasets) ` or `[LegiScan_Import::updateDatasets()](https://api.legiscan.com/docs/class-LegiScan_Import.html#_updateDatasets) ` and download the getDataset payloads, extract the ZIP file and import with LegiScan\_Bulk::importDataset

Take array of eligible `dataset` objects from `[LegiScan_Import::scanDatasets()](https://api.legiscan.com/docs/class-LegiScan_Import.html#_scanDatasets) ` or `[LegiScan_Import::updateDatasets()](https://api.legiscan.com/docs/class-LegiScan_Import.html#_updateDatasets) ` and download the getDataset payloads, extract the ZIP file and import with LegiScan\_Bulk::importDataset

#### Parameters

$downloads

An array of `dataset` objects from getDatasetList to download and import

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) ` | | | | | | --- | --- | --- |Properties summary | `` protected `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` `` | [$legiscan](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#78-83 "Go to source code")

Instance of `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) `

Instance of `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#$legiscan) | | `` protected `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` `` | [$logic](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#84-89 "Go to source code")

Instance of `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) `

Instance of `[LegiScan_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) ` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#$logic) | | `` protected `[LegiScan_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) ` `` | [$bulk](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#90-95 "Go to source code")

Instance of `[LegiScan_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) `

Instance of `[LegiScan_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) ` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#$bulk) | | `` protected `[PDO](https://api.legiscan.com/docs/class-PDO.html) ` `` | [$db](https://api.legiscan.com/docs/source-class-LegiScan_Import.html#96-101 "Go to source code")

Database object `[PDO](https://api.legiscan.com/docs/class-PDO.html) `

Database object `[PDO](https://api.legiscan.com/docs/class-PDO.html) ` | [#](https://api.legiscan.com/docs/class-LegiScan_Import.html#$db) | --- # Class LegiScan_Process | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [LegiScan\_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) * [LegiScan\_Process](https://api.legiscan.com/docs/class-LegiScan_Process.html) * [LegiScan\_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) * [LegiScan\_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class LegiScan\_Process ======================= LegiScan API Database Process Class Class that processes decoded API payloads from `[LegiScan_Bulk](https://api.legiscan.com/docs/class-LegiScan_Bulk.html) `, `[LegiScan_Pull](https://api.legiscan.com/docs/class-LegiScan_Pull.html) ` or `[LegiScan_Push](https://api.legiscan.com/docs/class-LegiScan_Push.html) ` into the database. Each `process*()` function maps to the corresponding API response to INSERT or UPDATE the necessary data. **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[API](https://api.legiscan.com/docs/package-LegiScan.API.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **See:** `[LegiScan_CommandLine](https://api.legiscan.com/docs/class-LegiScan_CommandLine.html) ` **See:** `[LegiScan_Import](https://api.legiscan.com/docs/class-LegiScan_Import.html) ` **See:** `[LegiScan_Endpoint](https://api.legiscan.com/docs/class-LegiScan_Endpoint.html) ` **See:** `[LegiScan_Worker](https://api.legiscan.com/docs/class-LegiScan_Worker.html) ` **Link:** [https://api.legiscan.com/dl/](https://api.legiscan.com/dl/) **Link:** [https://legiscan.com/legiscan](https://legiscan.com/legiscan) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#1979-5126 "Go to source code") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#___construct)
`[__construct](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2037-2078 "Go to source code") ( )`

Class constructor, connects to database and caching layers

Class constructor, connects to database and caching layers

#### Throws

`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processSessionList)
`[processSessionList](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2082-2149 "Go to source code") ( array $payload )`

Process a session list payload

Process a session list payload

#### Parameters

$payload

The decoded internal payload representing a session list

#### Returns

boolean
Indicating the success/failure of session list payload processing

#### Throws

`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processSession)
`[processSession](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2153-2218 "Go to source code") ( array $payload )`

Process a single session payload

Process a single session payload

#### Parameters

$payload

The decoded internal payload representing a session

#### Returns

boolean
Indicating the success/failure of session payload processing

#### Throws

`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public integer[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processMasterList)
`[processMasterList](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2222-2277 "Go to source code") ( array $payload, integer $import_type = LegiScan::IMPORT_ALL )`

Process a master list payload, adding any necessary missing child objects to the missing list

Process a master list payload, adding any necessary missing child objects to the missing list

#### Parameters

$payload

The decoded internal payload representing a master list

$import\_type

The `LegiScan::IMPORT_*` to control how bills are selected for import

#### Returns

integer\[\]
Returns an array of missing/changed bill\_id or FALSE on processing errors

#### Throws

`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) ` | | `public mixed[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processBill)
`[processBill](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2281-3592 "Go to source code") ( array $payload )`

Process a bill payload, adding any necessary missing child objects to the missing list

Process a bill payload, adding any necessary missing child objects to the missing list

#### Parameters

$payload

The decoded internal payload representing a bill

#### Returns

mixed\[\]
Array of objects : ids that are missing and need to be requested

#### Throws

`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processBillText)
`[processBillText](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#3596-3703 "Go to source code") ( array $payload )`

Process a bill text payload

Process a bill text payload

#### Parameters

$payload

The decoded internal payload representing a bill text

#### Returns

boolean
Indicating the success/failure of bill text payload processing

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) `
`[APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) `
`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processAmendment)
`[processAmendment](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#3707-3822 "Go to source code") ( array $payload )`

Process an amendment payload

Process an amendment payload

#### Parameters

$payload

The decoded internal payload representing an amendment

#### Returns

boolean
Indicating the success/failure of amendment payload processing

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) `
`[APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) `
`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processSupplement)
`[processSupplement](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#3826-3939 "Go to source code") ( array $payload )`

Process a supplement payload

Process a supplement payload

#### Parameters

$payload

The decoded internal payload representing a supplement

#### Returns

boolean
Indicating the success/failure of supplement payload processing

#### Throws

`[APIException](https://api.legiscan.com/docs/class-APIException.html) `
`[APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) `
`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public integer[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processRollCall)
`[processRollCall](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#3943-4048 "Go to source code") ( array $payload )`

Process a roll call payload

Process a roll call payload

#### Parameters

$payload

The decoded internal payload representing a roll call

#### Returns

integer\[\]
Returns a list of missing people\_id FALSE on processing errors

#### Throws

`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processPerson)
`[processPerson](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4052-4142 "Go to source code") ( array $payload )`

Process a person payload

Process a person payload

#### Parameters

$payload

The decoded internal payload representing a person

#### Returns

boolean
Indicating the success/failure of person payload processing

#### Throws

`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) `
`[PDOException](https://api.legiscan.com/docs/class-PDOException.html) ` | | `public integer[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processSearch)
`[processSearch](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4146-4207 "Go to source code") ( array $payload, integer $import_type = LegiScan::IMPORT_ALL, integer $relevance_cutoff = 0 )`

Process a search result and identify bills to be imported

Process a search result and identify bills to be imported

#### Parameters

$payload

The decoded internal payload representing a search result

$import\_type

Control what condition triggers a bill to be flagged for importing

$relevance\_cutoff

Results must also match have this relevance score or higher

#### Returns

integer\[\]
List of LegiScan bill\_ids that qualify for importing | | `public integer[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_processMonitorList)
`[processMonitorList](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4211-4264 "Go to source code") ( array $payload, integer $import_type = LegiScan::IMPORT_ALL )`

Process a monitored list payload, adding any necessary missing child objects to the missing list

Process a monitored list payload, adding any necessary missing child objects to the missing list

#### Parameters

$payload

The decoded internal payload representing a monitored list

$import\_type

The `LegiScan::IMPORT_*` to control how bills are selected for import

#### Returns

integer\[\]
Returns an array of missing/changed bill\_id or FALSE on processing errors

#### Throws

`[APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) ` | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_monitor)
`[monitor](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4268-4318 "Go to source code") ( integer $bill_id, boolean $add = true, boolean $stance = LegiScan::STANCE_WATCH )`

Add or remove a bill\_id from the `ls_monitor` list

Add or remove a bill\_id from the `ls_monitor` list

#### Parameters

$bill\_id

The bill\_id to add or remove

$add

Add to list when true, remove when false

$stance

Stance on the bill from Watch, Support, Oppose

#### Returns

boolean
Indicating the success/failure of manipulating ignore list | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_ignore)
`[ignore](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4322-4364 "Go to source code") ( integer $bill_id, boolean $add = true )`

Add or remove a bill\_id from the `ls_ignore` list

Add or remove a bill\_id from the `ls_ignore` list

#### Parameters

$bill\_id

The bill\_id to add or remove

$add

Add to list when true, remove when false

#### Returns

boolean
Indicating the success/failure of manipulating ignore list | | `public boolean\|integer` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_checkExists)
`[checkExists](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4368-4455 "Go to source code") ( string $table, integer $id, boolean $skip_cache = false )`

Check to see if a key exists in a table, results are cached via `[LegiScan_Cache_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) `

Check to see if a key exists in a table, results are cached via `[LegiScan_Cache_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) `

#### Parameters

$table

Base name of the table to check

$id

Key id to check for

$skip\_cache

Bypass cache and do direct lookup

#### Returns

boolean\|integer
Returns FALSE if does not exist, otherwise the $id is returned | | `` private `[PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ` `` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_makeSQLStatement)
`[makeSQLStatement](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4459-4527 "Go to source code") ( string $type, string $table, array[] $updates, array[] $keys )`

Create a PDO statatement for INSERT/UPDATE and bound values ready for execute()

Create a PDO statatement for INSERT/UPDATE and bound values ready for execute()

#### Parameters

$type

Type of SQL statement to generate

$table

Table name

$updates

Array of field => array(value, type) pairs for updates

$keys

Arry of field => array(value, type) pairs for table key(s)

#### Returns

`[PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) `
PDO prepared and bound statement | | `private mixed[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_billInit)
`[billInit](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4531-4579 "Go to source code") ( )`

Create a skeleton data structure that will be filled by `[LegiScan_Process::loadBill()](https://api.legiscan.com/docs/class-LegiScan_Process.html#_loadBill) `

Create a skeleton data structure that will be filled by `[LegiScan_Process::loadBill()](https://api.legiscan.com/docs/class-LegiScan_Process.html#_loadBill) `

#### Returns

mixed\[\]
The blank bill data structure | | `public mixed[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_loadBill)
`[loadBill](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4583-4843 "Go to source code") ( integer $bill_id )`

Recreate a data structure that mimics the getBill payload for comparison when updating existing bills

Recreate a data structure that mimics the getBill payload for comparison when updating existing bills

#### Parameters

$bill\_id

The bill\_id to load

#### Returns

mixed\[\]
The data structure representing a bill | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_request)
`[request](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4847-4874 "Go to source code") ( string $object, integer $id )`

Add an `object:id` pair to the missing list while preventing duplications

Add an `object:id` pair to the missing list while preventing duplications

#### Parameters

$object

The name of the type of object being requested

$id

The object LegiScan ID of the requested object

#### Returns

boolean
Indicating the success/failure of adding to the missing list | | `public array` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_getMissing)
`[getMissing](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4878-4887 "Go to source code") ( )`

Get the list of missing objects, if any, from the most recent process run

Get the list of missing objects, if any, from the most recent process run

#### Returns

array
The structured list of missing objects | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_resetMissing)
`[resetMissing](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4891-4903 "Go to source code") ( )`

Reset the list of missing objects

Reset the list of missing objects

#### Returns

boolean
Indicating success/failure of the reset | | `` public `[PDO](https://api.legiscan.com/docs/class-PDO.html) ` `` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_getDB)
`[getDB](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4907-4917 "Go to source code") ( )`

Return the DB handle so others can play if needed

Return the DB handle so others can play if needed

#### Returns

`[PDO](https://api.legiscan.com/docs/class-PDO.html) `
Database PDO handle | | `private string\|null` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_dbDate)
`[dbDate](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4921-4937 "Go to source code") ( string $date )`

Massage '0000-00-00' date to NULL when operating under PostgreSQL

Massage '0000-00-00' date to NULL when operating under PostgreSQL

#### Parameters

$date

The date to massage

#### Returns

string\|null
The massaged and relaxed date | | `public array[]` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_getStateList)
`[getStateList](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4941-4962 "Go to source code") ( )`

Get a list of state table records for ALL substitutions

Get a list of state table records for ALL substitutions

#### Returns

array\[\]
Array of state table rows | | `public boolean` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_middlewareSignal)
`[middlewareSignal](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#4966-5053 "Go to source code") ( string $object, integer $id )`

Send a signal to the middleware that data has changed so appropriate steps can be taken

Send a signal to the middleware that data has changed so appropriate steps can be taken

#### Parameters

$object

The type of object

$id

The object ID

#### Returns

boolean
Indicating the success/failure of sending signal | | `public string` | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#_getCacheFilename)
`[getCacheFilename](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#5057-5124 "Go to source code") ( string $object, integer $id )`

Generate a document cache filename path fragment

Generate a document cache filename path fragment

#### Parameters

$object

The type of document object

$id

The document object ID

#### Returns

string
Filename path fragment for the location under the document cache directory | | | | | | --- | --- | --- |Properties summary | `protected array[]` | [$missing](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2000-2005 "Go to source code")

Array of object ids that are missing and should be requested

Array of object ids that are missing and should be requested | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#$missing) | | `` protected `[PDO](https://api.legiscan.com/docs/class-PDO.html) ` `` | [$db](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2007-2012 "Go to source code")

PDO Database object handle

PDO Database object handle | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#$db) | | `` protected `[LegiScan_Cache_File](https://api.legiscan.com/docs/class-LegiScan_Cache_File.html) ` `` | [$cache](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2014-2019 "Go to source code")

LegiScan document cache object handle

LegiScan document cache object handle | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#$cache) | | `` protected `[LegiScan_Cache_Memory](https://api.legiscan.com/docs/class-LegiScan_Cache_Memory.html) ` `` | [$memcache](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2021-2026 "Go to source code")

LegiScan memory cache object handle

LegiScan memory cache object handle | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#$memcache) | | `private boolean` | [$massage](https://api.legiscan.com/docs/source-class-LegiScan_Process.html#2028-2033 "Go to source code")

Should dates be massaged for PostgreSQL in case of '0000-00-00'

Should dates be massaged for PostgreSQL in case of '0000-00-00' | [#](https://api.legiscan.com/docs/class-LegiScan_Process.html#$massage) | --- # Class APIAccessException | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Exceptions * [APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) * [APIAuthTokenException](https://api.legiscan.com/docs/class-APIAuthTokenException.html) * [APIException](https://api.legiscan.com/docs/class-APIException.html) * [APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class APIAccessException ======================== Exception class for API missing file / bad permissions [Exception](https://api.legiscan.com/docs/class-Exception.html) ![Extended by](https://api.legiscan.com/docs/resources/inherit.png) **APIAccessException** **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-APIAccessException.html#23-27 "Go to source code") Methods inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#methods) `[__construct()](https://api.legiscan.com/docs/class-Exception.html#___construct) , [__toString()](https://api.legiscan.com/docs/class-Exception.html#___toString) , [__wakeup()](https://api.legiscan.com/docs/class-Exception.html#___wakeup) , [getCode()](https://api.legiscan.com/docs/class-Exception.html#_getCode) , [getFile()](https://api.legiscan.com/docs/class-Exception.html#_getFile) , [getLine()](https://api.legiscan.com/docs/class-Exception.html#_getLine) , [getMessage()](https://api.legiscan.com/docs/class-Exception.html#_getMessage) , [getPrevious()](https://api.legiscan.com/docs/class-Exception.html#_getPrevious) , [getTrace()](https://api.legiscan.com/docs/class-Exception.html#_getTrace) , [getTraceAsString()](https://api.legiscan.com/docs/class-Exception.html#_getTraceAsString) `Properties inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#properties) `[$code](https://api.legiscan.com/docs/class-Exception.html#$code) , [$file](https://api.legiscan.com/docs/class-Exception.html#$file) , [$line](https://api.legiscan.com/docs/class-Exception.html#$line) , [$message](https://api.legiscan.com/docs/class-Exception.html#$message) ` --- # Class APIAuthTokenException | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Exceptions * [APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) * [APIAuthTokenException](https://api.legiscan.com/docs/class-APIAuthTokenException.html) * [APIException](https://api.legiscan.com/docs/class-APIException.html) * [APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class APIAuthTokenException =========================== Exception class for API authorization token errors [Exception](https://api.legiscan.com/docs/class-Exception.html) ![Extended by](https://api.legiscan.com/docs/resources/inherit.png) **APIAuthTokenException** **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-APIAuthTokenException.html#35-39 "Go to source code") Methods inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#methods) `[__construct()](https://api.legiscan.com/docs/class-Exception.html#___construct) , [__toString()](https://api.legiscan.com/docs/class-Exception.html#___toString) , [__wakeup()](https://api.legiscan.com/docs/class-Exception.html#___wakeup) , [getCode()](https://api.legiscan.com/docs/class-Exception.html#_getCode) , [getFile()](https://api.legiscan.com/docs/class-Exception.html#_getFile) , [getLine()](https://api.legiscan.com/docs/class-Exception.html#_getLine) , [getMessage()](https://api.legiscan.com/docs/class-Exception.html#_getMessage) , [getPrevious()](https://api.legiscan.com/docs/class-Exception.html#_getPrevious) , [getTrace()](https://api.legiscan.com/docs/class-Exception.html#_getTrace) , [getTraceAsString()](https://api.legiscan.com/docs/class-Exception.html#_getTraceAsString) `Properties inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#properties) `[$code](https://api.legiscan.com/docs/class-Exception.html#$code) , [$file](https://api.legiscan.com/docs/class-Exception.html#$file) , [$line](https://api.legiscan.com/docs/class-Exception.html#$line) , [$message](https://api.legiscan.com/docs/class-Exception.html#$message) ` --- # Class APIException | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Exceptions * [APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) * [APIAuthTokenException](https://api.legiscan.com/docs/class-APIAuthTokenException.html) * [APIException](https://api.legiscan.com/docs/class-APIException.html) * [APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class APIException ================== Exception class for API general errors [Exception](https://api.legiscan.com/docs/class-Exception.html) ![Extended by](https://api.legiscan.com/docs/resources/inherit.png) **APIException** **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-APIException.html#17-21 "Go to source code") Methods inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#methods) `[__construct()](https://api.legiscan.com/docs/class-Exception.html#___construct) , [__toString()](https://api.legiscan.com/docs/class-Exception.html#___toString) , [__wakeup()](https://api.legiscan.com/docs/class-Exception.html#___wakeup) , [getCode()](https://api.legiscan.com/docs/class-Exception.html#_getCode) , [getFile()](https://api.legiscan.com/docs/class-Exception.html#_getFile) , [getLine()](https://api.legiscan.com/docs/class-Exception.html#_getLine) , [getMessage()](https://api.legiscan.com/docs/class-Exception.html#_getMessage) , [getPrevious()](https://api.legiscan.com/docs/class-Exception.html#_getPrevious) , [getTrace()](https://api.legiscan.com/docs/class-Exception.html#_getTrace) , [getTraceAsString()](https://api.legiscan.com/docs/class-Exception.html#_getTraceAsString) `Properties inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#properties) `[$code](https://api.legiscan.com/docs/class-Exception.html#$code) , [$file](https://api.legiscan.com/docs/class-Exception.html#$file) , [$line](https://api.legiscan.com/docs/class-Exception.html#$line) , [$message](https://api.legiscan.com/docs/class-Exception.html#$message) ` --- # Class APIStatusException | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Exceptions * [APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) * [APIAuthTokenException](https://api.legiscan.com/docs/class-APIAuthTokenException.html) * [APIException](https://api.legiscan.com/docs/class-APIException.html) * [APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class APIStatusException ======================== Exception class for API status errors [Exception](https://api.legiscan.com/docs/class-Exception.html) ![Extended by](https://api.legiscan.com/docs/resources/inherit.png) **APIStatusException** **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) **Copyright:** 2010-2020 LegiScan LLC **License:** [https://opensource.org/licenses/BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) **Author:** LegiScan API Team [api@legiscan.com](mailto:api@legiscan.com) **Located at** [LegiScan.php](https://api.legiscan.com/docs/source-class-APIStatusException.html#29-33 "Go to source code") Methods inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#methods) `[__construct()](https://api.legiscan.com/docs/class-Exception.html#___construct) , [__toString()](https://api.legiscan.com/docs/class-Exception.html#___toString) , [__wakeup()](https://api.legiscan.com/docs/class-Exception.html#___wakeup) , [getCode()](https://api.legiscan.com/docs/class-Exception.html#_getCode) , [getFile()](https://api.legiscan.com/docs/class-Exception.html#_getFile) , [getLine()](https://api.legiscan.com/docs/class-Exception.html#_getLine) , [getMessage()](https://api.legiscan.com/docs/class-Exception.html#_getMessage) , [getPrevious()](https://api.legiscan.com/docs/class-Exception.html#_getPrevious) , [getTrace()](https://api.legiscan.com/docs/class-Exception.html#_getTrace) , [getTraceAsString()](https://api.legiscan.com/docs/class-Exception.html#_getTraceAsString) `Properties inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#properties) `[$code](https://api.legiscan.com/docs/class-Exception.html#$code) , [$file](https://api.legiscan.com/docs/class-Exception.html#$file) , [$line](https://api.legiscan.com/docs/class-Exception.html#$line) , [$message](https://api.legiscan.com/docs/class-Exception.html#$message) ` --- # Function expect_user | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function expect\_user ===================== Check to see if the current user is the expected user **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-expect_user.html#173-192 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `string` | `$expect` | The user name that is expected | | | | | --- | --- |Return value summary | `boolean` | True if running as expected user, false otherwise | --- # Function is_cli | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function is\_cli ================ Simple check to see if script running via the CLI SAPI **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-is_cli.html#227-247 "Go to source code") | | | | --- | --- |Return value summary | `boolean` | True if running under CLI, false otherwise | --- # Function legiscan_getopt | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function legiscan\_getopt ========================= Wrapper around getopt() that also strips recognized options from $argv **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-legiscan_getopt.html#11-74 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `array` | `$valid_options = array()` | An array of long options that are valid | | `string` | `$extra = ''` | Additional text that will be added to --help output | | | | | --- | --- |Return value summary | `array` | The parsed options and command arguments | --- # Function legiscan_help | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function legiscan\_help ======================= Print some help text for command line options and exit() **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-legiscan_help.html#101-169 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `array` | `$parameters` | The valid list of command line options | | `string` | `$extra = ''` | Additional text that will be added to output | --- # Function legiscan_option | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function legiscan\_option ========================= Check to see if an option is set and return the value if it had an argument, otherwise true/false **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-legiscan_option.html#77-98 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `string` | `$option` | Option name to lookup | | `mixed` | `$default = false` | Return $default if no option set | | | | | --- | --- |Return value summary | `mixed` | The parameter argument or true if a simple option set | --- # Function memory_usage | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function memory\_usage ====================== Get the current and peak memory usage as a string for logging **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-memory_usage.html#250-267 "Go to source code") | | | | --- | --- |Return value summary | `string` | The memory usage log message | --- # Function prettyPrint | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function prettyPrint ==================== Given a compact JSON string return a pretty printed version **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-prettyPrint.html#299-372 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `string` | `$json` | The JSON string to be made fabulous | | | | | --- | --- |Return value summary | `string` | The beautified JSON string | --- # Function sec2hms | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function sec2hms ================ Convert elapsed seconds to H:M:S format **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-sec2hms.html#270-295 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `integer` | `$num_secs` | The elapsed number of seconds to convert | | | | | --- | --- |Return value summary | `string` | The H:M:S string for $num\_secs | --- # Function timer_clear | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function timer\_clear ===================== Clear and reset a named timer **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-timer_clear.html#376-388 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `string` | `$name` | The name of the timer | --- # Function timer_read | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function timer\_read ==================== Read a named timer value without stopping it **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-timer_read.html#391-409 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `string` | `$name` | The name of the timer | | | | | --- | --- |Return value summary | `float` | The current timer value | --- # Function timer_start | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function timer\_start ===================== Start a named timer, if a timer is started and stopped multiple times, the intervals will be accumulated **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-timer_start.html#412-425 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `string` | `$name` | The name of the timer | --- # Function timer_stop | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function timer\_stop ==================== Stop a named timer and return the timer values **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-timer_stop.html#428-448 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `string` | `$name` | The name of the timer | | | | | --- | --- |Return value summary | `array` | Contains the count of timer start/stops and the accumulated time in ms | --- # Function yes_no_prompt | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Functions * [expect\_user](https://api.legiscan.com/docs/function-expect_user.html) * [is\_cli](https://api.legiscan.com/docs/function-is_cli.html) * [legiscan\_getopt](https://api.legiscan.com/docs/function-legiscan_getopt.html) * [legiscan\_help](https://api.legiscan.com/docs/function-legiscan_help.html) * [legiscan\_option](https://api.legiscan.com/docs/function-legiscan_option.html) * [memory\_usage](https://api.legiscan.com/docs/function-memory_usage.html) * [prettyPrint](https://api.legiscan.com/docs/function-prettyPrint.html) * [sec2hms](https://api.legiscan.com/docs/function-sec2hms.html) * [timer\_clear](https://api.legiscan.com/docs/function-timer_clear.html) * [timer\_read](https://api.legiscan.com/docs/function-timer_read.html) * [timer\_start](https://api.legiscan.com/docs/function-timer_start.html) * [timer\_stop](https://api.legiscan.com/docs/function-timer_stop.html) * [yes\_no\_prompt](https://api.legiscan.com/docs/function-yes_no_prompt.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Function Function yes\_no\_prompt ======================== Ask for a Yes/No response if on terminal, otherwise return default answer **Package:** [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) \\[Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) **Located at** [common.php](https://api.legiscan.com/docs/source-function-yes_no_prompt.html#196-223 "Go to source code") | | | | | --- | --- | --- |Parameters summary | `boolean` | `$default = false` | The answer used if not interactive | | | | | --- | --- |Return value summary | `boolean` | True if the answer is Yes, false if the answer is No | --- # Interface Traversable | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [PDO](https://api.legiscan.com/docs/class-PDO.html) * [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ### Interfaces * [Traversable](https://api.legiscan.com/docs/class-Traversable.html) ### Exceptions * [Exception](https://api.legiscan.com/docs/class-Exception.html) * [PDOException](https://api.legiscan.com/docs/class-PDOException.html) * [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Interface Traversable ===================== #### Direct known implementers [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) **PHP Extension:** [Core](http://php.net/manual/en "Go to PHP documentation") **Documented at** [php.net](http://php.net/manual/en/class.traversable.php "Go to PHP documentation") --- # Class PDOException | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [PDO](https://api.legiscan.com/docs/class-PDO.html) * [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ### Interfaces * [Traversable](https://api.legiscan.com/docs/class-Traversable.html) ### Exceptions * [Exception](https://api.legiscan.com/docs/class-Exception.html) * [PDOException](https://api.legiscan.com/docs/class-PDOException.html) * [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class PDOException ================== [Exception](https://api.legiscan.com/docs/class-Exception.html) ![Extended by](https://api.legiscan.com/docs/resources/inherit.png) [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) ![Extended by](https://api.legiscan.com/docs/resources/inherit.png) **PDOException** **PHP Extension:** [PDO](http://php.net/manual/en/book.pdo.php "Go to PHP documentation") **Documented at** [php.net](http://php.net/manual/en/class.pdoexception.php "Go to PHP documentation") Methods inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#methods) `[__construct()](https://api.legiscan.com/docs/class-Exception.html#___construct) , [__toString()](https://api.legiscan.com/docs/class-Exception.html#___toString) , [__wakeup()](https://api.legiscan.com/docs/class-Exception.html#___wakeup) , [getCode()](https://api.legiscan.com/docs/class-Exception.html#_getCode) , [getFile()](https://api.legiscan.com/docs/class-Exception.html#_getFile) , [getLine()](https://api.legiscan.com/docs/class-Exception.html#_getLine) , [getMessage()](https://api.legiscan.com/docs/class-Exception.html#_getMessage) , [getPrevious()](https://api.legiscan.com/docs/class-Exception.html#_getPrevious) , [getTrace()](https://api.legiscan.com/docs/class-Exception.html#_getTrace) , [getTraceAsString()](https://api.legiscan.com/docs/class-Exception.html#_getTraceAsString) ` | | | | | --- | --- | --- |Properties summary | `public` | [$errorInfo](http://php.net/manual/en/class.pdoexception.php#pdoexception.props.errorinfo "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-PDOException.html#$errorInfo) | Properties inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#properties) `[$code](https://api.legiscan.com/docs/class-Exception.html#$code) , [$file](https://api.legiscan.com/docs/class-Exception.html#$file) , [$line](https://api.legiscan.com/docs/class-Exception.html#$line) , [$message](https://api.legiscan.com/docs/class-Exception.html#$message) ` --- # Class RuntimeException | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [PDO](https://api.legiscan.com/docs/class-PDO.html) * [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ### Interfaces * [Traversable](https://api.legiscan.com/docs/class-Traversable.html) ### Exceptions * [Exception](https://api.legiscan.com/docs/class-Exception.html) * [PDOException](https://api.legiscan.com/docs/class-PDOException.html) * [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class RuntimeException ====================== [Exception](https://api.legiscan.com/docs/class-Exception.html) ![Extended by](https://api.legiscan.com/docs/resources/inherit.png) **RuntimeException** #### Direct known subclasses [PDOException](https://api.legiscan.com/docs/class-PDOException.html) **PHP Extension:** [SPL](http://php.net/manual/en/book.spl.php "Go to PHP documentation") **Documented at** [php.net](http://php.net/manual/en/class.runtimeexception.php "Go to PHP documentation") Methods inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#methods) `[__construct()](https://api.legiscan.com/docs/class-Exception.html#___construct) , [__toString()](https://api.legiscan.com/docs/class-Exception.html#___toString) , [__wakeup()](https://api.legiscan.com/docs/class-Exception.html#___wakeup) , [getCode()](https://api.legiscan.com/docs/class-Exception.html#_getCode) , [getFile()](https://api.legiscan.com/docs/class-Exception.html#_getFile) , [getLine()](https://api.legiscan.com/docs/class-Exception.html#_getLine) , [getMessage()](https://api.legiscan.com/docs/class-Exception.html#_getMessage) , [getPrevious()](https://api.legiscan.com/docs/class-Exception.html#_getPrevious) , [getTrace()](https://api.legiscan.com/docs/class-Exception.html#_getTrace) , [getTraceAsString()](https://api.legiscan.com/docs/class-Exception.html#_getTraceAsString) `Properties inherited from [Exception](https://api.legiscan.com/docs/class-Exception.html#properties) `[$code](https://api.legiscan.com/docs/class-Exception.html#$code) , [$file](https://api.legiscan.com/docs/class-Exception.html#$file) , [$line](https://api.legiscan.com/docs/class-Exception.html#$line) , [$message](https://api.legiscan.com/docs/class-Exception.html#$message) ` --- # Class PDOStatement | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [PDO](https://api.legiscan.com/docs/class-PDO.html) * [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ### Interfaces * [Traversable](https://api.legiscan.com/docs/class-Traversable.html) ### Exceptions * [Exception](https://api.legiscan.com/docs/class-Exception.html) * [PDOException](https://api.legiscan.com/docs/class-PDOException.html) * [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class PDOStatement ================== **PDOStatement** implements [Traversable](https://api.legiscan.com/docs/class-Traversable.html) **PHP Extension:** [PDO](http://php.net/manual/en/book.pdo.php "Go to PHP documentation") **Documented at** [php.net](http://php.net/manual/en/class.pdostatement.php "Go to PHP documentation") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_execute)
`[execute](http://php.net/manual/en/pdostatement.execute.php "Go to PHP documentation") ( $bound_input_params )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_fetch)
`[fetch](http://php.net/manual/en/pdostatement.fetch.php "Go to PHP documentation") ( $how, $orientation, $offset )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_bindParam)
`[bindParam](http://php.net/manual/en/pdostatement.bindparam.php "Go to PHP documentation") ( $paramno, & $param, $type, $maxlen, $driverdata )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_bindColumn)
`[bindColumn](http://php.net/manual/en/pdostatement.bindcolumn.php "Go to PHP documentation") ( $column, & $param, $type, $maxlen, $driverdata )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_bindValue)
`[bindValue](http://php.net/manual/en/pdostatement.bindvalue.php "Go to PHP documentation") ( $paramno, $param, $type )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_rowCount)
`[rowCount](http://php.net/manual/en/pdostatement.rowcount.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_fetchColumn)
`[fetchColumn](http://php.net/manual/en/pdostatement.fetchcolumn.php "Go to PHP documentation") ( $column_number )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_fetchAll)
`[fetchAll](http://php.net/manual/en/pdostatement.fetchall.php "Go to PHP documentation") ( $how, $class_name, $ctor_args )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_fetchObject)
`[fetchObject](http://php.net/manual/en/pdostatement.fetchobject.php "Go to PHP documentation") ( $class_name, $ctor_args )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_errorCode)
`[errorCode](http://php.net/manual/en/pdostatement.errorcode.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_errorInfo)
`[errorInfo](http://php.net/manual/en/pdostatement.errorinfo.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_setAttribute)
`[setAttribute](http://php.net/manual/en/pdostatement.setattribute.php "Go to PHP documentation") ( $attribute, $value )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_getAttribute)
`[getAttribute](http://php.net/manual/en/pdostatement.getattribute.php "Go to PHP documentation") ( $attribute )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_columnCount)
`[columnCount](http://php.net/manual/en/pdostatement.columncount.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_getColumnMeta)
`[getColumnMeta](http://php.net/manual/en/pdostatement.getcolumnmeta.php "Go to PHP documentation") ( $column )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_setFetchMode)
`[setFetchMode](http://php.net/manual/en/pdostatement.setfetchmode.php "Go to PHP documentation") ( $mode, $params )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_nextRowset)
`[nextRowset](http://php.net/manual/en/pdostatement.nextrowset.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_closeCursor)
`[closeCursor](http://php.net/manual/en/pdostatement.closecursor.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#_debugDumpParams)
`[debugDumpParams](http://php.net/manual/en/pdostatement.debugdumpparams.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#___wakeup)
`[__wakeup](http://php.net/manual/en/pdostatement.wakeup.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-PDOStatement.html#___sleep)
`[__sleep](http://php.net/manual/en/pdostatement.sleep.php "Go to PHP documentation") ( )` | | | | | | --- | --- | --- |Properties summary | `public` | [$queryString](http://php.net/manual/en/class.pdostatement.php#pdostatement.props.querystring "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-PDOStatement.html#$queryString) | --- # Class PDO | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [PDO](https://api.legiscan.com/docs/class-PDO.html) * [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ### Interfaces * [Traversable](https://api.legiscan.com/docs/class-Traversable.html) ### Exceptions * [Exception](https://api.legiscan.com/docs/class-Exception.html) * [PDOException](https://api.legiscan.com/docs/class-PDOException.html) * [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class PDO ========= **PHP Extension:** [PDO](http://php.net/manual/en/book.pdo.php "Go to PHP documentation") **Documented at** [php.net](http://php.net/manual/en/class.pdo.php "Go to PHP documentation") | | | | --- | --- |Methods summary | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#___construct)
`[__construct](http://php.net/manual/en/pdo.construct.php "Go to PHP documentation") ( $dsn, $username, $passwd, $options )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_prepare)
`[prepare](http://php.net/manual/en/pdo.prepare.php "Go to PHP documentation") ( $statement, $options )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_beginTransaction)
`[beginTransaction](http://php.net/manual/en/pdo.begintransaction.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_commit)
`[commit](http://php.net/manual/en/pdo.commit.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_rollBack)
`[rollBack](http://php.net/manual/en/pdo.rollback.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_inTransaction)
`[inTransaction](http://php.net/manual/en/pdo.intransaction.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_setAttribute)
`[setAttribute](http://php.net/manual/en/pdo.setattribute.php "Go to PHP documentation") ( $attribute, $value )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_exec)
`[exec](http://php.net/manual/en/pdo.exec.php "Go to PHP documentation") ( $query )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_query)
`[query](http://php.net/manual/en/pdo.query.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_lastInsertId)
`[lastInsertId](http://php.net/manual/en/pdo.lastinsertid.php "Go to PHP documentation") ( $seqname )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_errorCode)
`[errorCode](http://php.net/manual/en/pdo.errorcode.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_errorInfo)
`[errorInfo](http://php.net/manual/en/pdo.errorinfo.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_getAttribute)
`[getAttribute](http://php.net/manual/en/pdo.getattribute.php "Go to PHP documentation") ( $attribute )` | | `public` | [#](https://api.legiscan.com/docs/class-PDO.html#_quote)
`[quote](http://php.net/manual/en/pdo.quote.php "Go to PHP documentation") ( $string, $paramtype )` | | `final public` | [#](https://api.legiscan.com/docs/class-PDO.html#___wakeup)
`[__wakeup](http://php.net/manual/en/pdo.wakeup.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-PDO.html#___sleep)
`[__sleep](http://php.net/manual/en/pdo.sleep.php "Go to PHP documentation") ( )` | | `public static` | [#](https://api.legiscan.com/docs/class-PDO.html#_getAvailableDrivers)
`[getAvailableDrivers](http://php.net/manual/en/pdo.getavailabledrivers.php "Go to PHP documentation") ( )` | | | | | | --- | --- | --- |Constants summary | `integer` | `[**PARAM_BOOL**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-bool "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_BOOL)
`5` | | `integer` | `[**PARAM_NULL**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-null "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_NULL)
`0` | | `integer` | `[**PARAM_INT**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-int "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_INT)
`1` | | `integer` | `[**PARAM_STR**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-str "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_STR)
`2` | | `integer` | `[**PARAM_LOB**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-lob "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_LOB)
`3` | | `integer` | `[**PARAM_STMT**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-stmt "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_STMT)
`4` | | `integer` | `[**PARAM_INPUT_OUTPUT**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-input-output "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_INPUT_OUTPUT)
`2147483648` | | `integer` | `[**PARAM_EVT_ALLOC**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-evt-alloc "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_EVT_ALLOC)
`0` | | `integer` | `[**PARAM_EVT_FREE**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-evt-free "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_EVT_FREE)
`1` | | `integer` | `[**PARAM_EVT_EXEC_PRE**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-evt-exec-pre "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_EVT_EXEC_PRE)
`2` | | `integer` | `[**PARAM_EVT_EXEC_POST**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-evt-exec-post "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_EVT_EXEC_POST)
`3` | | `integer` | `[**PARAM_EVT_FETCH_PRE**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-evt-fetch-pre "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_EVT_FETCH_PRE)
`4` | | `integer` | `[**PARAM_EVT_FETCH_POST**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-evt-fetch-post "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_EVT_FETCH_POST)
`5` | | `integer` | `[**PARAM_EVT_NORMALIZE**](http://php.net/manual/en/class.pdo.php#pdo.constants.param-evt-normalize "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PARAM_EVT_NORMALIZE)
`6` | | `integer` | `[**FETCH_LAZY**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-lazy "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_LAZY)
`1` | | `integer` | `[**FETCH_ASSOC**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-assoc "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_ASSOC)
`2` | | `integer` | `[**FETCH_NUM**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-num "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_NUM)
`3` | | `integer` | `[**FETCH_BOTH**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-both "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_BOTH)
`4` | | `integer` | `[**FETCH_OBJ**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-obj "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_OBJ)
`5` | | `integer` | `[**FETCH_BOUND**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-bound "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_BOUND)
`6` | | `integer` | `[**FETCH_COLUMN**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-column "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_COLUMN)
`7` | | `integer` | `[**FETCH_CLASS**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-class "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_CLASS)
`8` | | `integer` | `[**FETCH_INTO**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-into "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_INTO)
`9` | | `integer` | `[**FETCH_FUNC**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-func "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_FUNC)
`10` | | `integer` | `[**FETCH_GROUP**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-group "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_GROUP)
`65536` | | `integer` | `[**FETCH_UNIQUE**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-unique "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_UNIQUE)
`196608` | | `integer` | `[**FETCH_KEY_PAIR**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-key-pair "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_KEY_PAIR)
`12` | | `integer` | `[**FETCH_CLASSTYPE**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-classtype "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_CLASSTYPE)
`262144` | | `integer` | `[**FETCH_SERIALIZE**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-serialize "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_SERIALIZE)
`524288` | | `integer` | `[**FETCH_PROPS_LATE**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-props-late "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_PROPS_LATE)
`1048576` | | `integer` | `[**FETCH_NAMED**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-named "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_NAMED)
`11` | | `integer` | `[**ATTR_AUTOCOMMIT**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-autocommit "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_AUTOCOMMIT)
`0` | | `integer` | `[**ATTR_PREFETCH**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-prefetch "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_PREFETCH)
`1` | | `integer` | `[**ATTR_TIMEOUT**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-timeout "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_TIMEOUT)
`2` | | `integer` | `[**ATTR_ERRMODE**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-errmode "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_ERRMODE)
`3` | | `integer` | `[**ATTR_SERVER_VERSION**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-server-version "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_SERVER_VERSION)
`4` | | `integer` | `[**ATTR_CLIENT_VERSION**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-client-version "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_CLIENT_VERSION)
`5` | | `integer` | `[**ATTR_SERVER_INFO**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-server-info "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_SERVER_INFO)
`6` | | `integer` | `[**ATTR_CONNECTION_STATUS**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-connection-status "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_CONNECTION_STATUS)
`7` | | `integer` | `[**ATTR_CASE**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-case "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_CASE)
`8` | | `integer` | `[**ATTR_CURSOR_NAME**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-cursor-name "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_CURSOR_NAME)
`9` | | `integer` | `[**ATTR_CURSOR**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-cursor "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_CURSOR)
`10` | | `integer` | `[**ATTR_ORACLE_NULLS**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-oracle-nulls "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_ORACLE_NULLS)
`11` | | `integer` | `[**ATTR_PERSISTENT**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-persistent "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_PERSISTENT)
`12` | | `integer` | `[**ATTR_STATEMENT_CLASS**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-statement-class "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_STATEMENT_CLASS)
`13` | | `integer` | `[**ATTR_FETCH_TABLE_NAMES**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-fetch-table-names "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_FETCH_TABLE_NAMES)
`14` | | `integer` | `[**ATTR_FETCH_CATALOG_NAMES**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-fetch-catalog-names "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_FETCH_CATALOG_NAMES)
`15` | | `integer` | `[**ATTR_DRIVER_NAME**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-driver-name "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_DRIVER_NAME)
`16` | | `integer` | `[**ATTR_STRINGIFY_FETCHES**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-stringify-fetches "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_STRINGIFY_FETCHES)
`17` | | `integer` | `[**ATTR_MAX_COLUMN_LEN**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-max-column-len "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_MAX_COLUMN_LEN)
`18` | | `integer` | `[**ATTR_EMULATE_PREPARES**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-emulate-prepares "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_EMULATE_PREPARES)
`20` | | `integer` | `[**ATTR_DEFAULT_FETCH_MODE**](http://php.net/manual/en/class.pdo.php#pdo.constants.attr-default-fetch-mode "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ATTR_DEFAULT_FETCH_MODE)
`19` | | `integer` | `[**ERRMODE_SILENT**](http://php.net/manual/en/class.pdo.php#pdo.constants.errmode-silent "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ERRMODE_SILENT)
`0` | | `integer` | `[**ERRMODE_WARNING**](http://php.net/manual/en/class.pdo.php#pdo.constants.errmode-warning "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ERRMODE_WARNING)
`1` | | `integer` | `[**ERRMODE_EXCEPTION**](http://php.net/manual/en/class.pdo.php#pdo.constants.errmode-exception "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ERRMODE_EXCEPTION)
`2` | | `integer` | `[**CASE_NATURAL**](http://php.net/manual/en/class.pdo.php#pdo.constants.case-natural "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#CASE_NATURAL)
`0` | | `integer` | `[**CASE_LOWER**](http://php.net/manual/en/class.pdo.php#pdo.constants.case-lower "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#CASE_LOWER)
`2` | | `integer` | `[**CASE_UPPER**](http://php.net/manual/en/class.pdo.php#pdo.constants.case-upper "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#CASE_UPPER)
`1` | | `integer` | `[**NULL_NATURAL**](http://php.net/manual/en/class.pdo.php#pdo.constants.null-natural "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#NULL_NATURAL)
`0` | | `integer` | `[**NULL_EMPTY_STRING**](http://php.net/manual/en/class.pdo.php#pdo.constants.null-empty-string "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#NULL_EMPTY_STRING)
`1` | | `integer` | `[**NULL_TO_STRING**](http://php.net/manual/en/class.pdo.php#pdo.constants.null-to-string "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#NULL_TO_STRING)
`2` | | `string` | `[**ERR_NONE**](http://php.net/manual/en/class.pdo.php#pdo.constants.err-none "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#ERR_NONE)
`'00000'` | | `integer` | `[**FETCH_ORI_NEXT**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-ori-next "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_ORI_NEXT)
`0` | | `integer` | `[**FETCH_ORI_PRIOR**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-ori-prior "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_ORI_PRIOR)
`1` | | `integer` | `[**FETCH_ORI_FIRST**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-ori-first "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_ORI_FIRST)
`2` | | `integer` | `[**FETCH_ORI_LAST**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-ori-last "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_ORI_LAST)
`3` | | `integer` | `[**FETCH_ORI_ABS**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-ori-abs "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_ORI_ABS)
`4` | | `integer` | `[**FETCH_ORI_REL**](http://php.net/manual/en/class.pdo.php#pdo.constants.fetch-ori-rel "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#FETCH_ORI_REL)
`5` | | `integer` | `[**CURSOR_FWDONLY**](http://php.net/manual/en/class.pdo.php#pdo.constants.cursor-fwdonly "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#CURSOR_FWDONLY)
`0` | | `integer` | `[**CURSOR_SCROLL**](http://php.net/manual/en/class.pdo.php#pdo.constants.cursor-scroll "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#CURSOR_SCROLL)
`1` | | `integer` | `[**MYSQL_ATTR_USE_BUFFERED_QUERY**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-use-buffered-query "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_USE_BUFFERED_QUERY)
`1000` | | `integer` | `[**MYSQL_ATTR_LOCAL_INFILE**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-local-infile "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_LOCAL_INFILE)
`1001` | | `integer` | `[**MYSQL_ATTR_INIT_COMMAND**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-init-command "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_INIT_COMMAND)
`1002` | | `integer` | `[**MYSQL_ATTR_COMPRESS**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-compress "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_COMPRESS)
`1003` | | `integer` | `[**MYSQL_ATTR_DIRECT_QUERY**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-direct-query "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_DIRECT_QUERY)
`1004` | | `integer` | `[**MYSQL_ATTR_FOUND_ROWS**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-found-rows "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_FOUND_ROWS)
`1005` | | `integer` | `[**MYSQL_ATTR_IGNORE_SPACE**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-ignore-space "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_IGNORE_SPACE)
`1006` | | `integer` | `[**MYSQL_ATTR_SSL_KEY**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-ssl-key "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_SSL_KEY)
`1007` | | `integer` | `[**MYSQL_ATTR_SSL_CERT**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-ssl-cert "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_SSL_CERT)
`1008` | | `integer` | `[**MYSQL_ATTR_SSL_CA**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-ssl-ca "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_SSL_CA)
`1009` | | `integer` | `[**MYSQL_ATTR_SSL_CAPATH**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-ssl-capath "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_SSL_CAPATH)
`1010` | | `integer` | `[**MYSQL_ATTR_SSL_CIPHER**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-ssl-cipher "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_SSL_CIPHER)
`1011` | | `integer` | `[**MYSQL_ATTR_SERVER_PUBLIC_KEY**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-server-public-key "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_SERVER_PUBLIC_KEY)
`1012` | | `integer` | `[**MYSQL_ATTR_MULTI_STATEMENTS**](http://php.net/manual/en/class.pdo.php#pdo.constants.mysql-attr-multi-statements "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#MYSQL_ATTR_MULTI_STATEMENTS)
`1013` | | `integer` | `[**PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT**](http://php.net/manual/en/class.pdo.php#pdo.constants.pgsql-attr-disable-native-prepared-statement "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT)
`1000` | | `integer` | `[**PGSQL_ATTR_DISABLE_PREPARES**](http://php.net/manual/en/class.pdo.php#pdo.constants.pgsql-attr-disable-prepares "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PGSQL_ATTR_DISABLE_PREPARES)
`1001` | | `integer` | `[**PGSQL_TRANSACTION_IDLE**](http://php.net/manual/en/class.pdo.php#pdo.constants.pgsql-transaction-idle "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PGSQL_TRANSACTION_IDLE)
`0` | | `integer` | `[**PGSQL_TRANSACTION_ACTIVE**](http://php.net/manual/en/class.pdo.php#pdo.constants.pgsql-transaction-active "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PGSQL_TRANSACTION_ACTIVE)
`1` | | `integer` | `[**PGSQL_TRANSACTION_INTRANS**](http://php.net/manual/en/class.pdo.php#pdo.constants.pgsql-transaction-intrans "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PGSQL_TRANSACTION_INTRANS)
`2` | | `integer` | `[**PGSQL_TRANSACTION_INERROR**](http://php.net/manual/en/class.pdo.php#pdo.constants.pgsql-transaction-inerror "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PGSQL_TRANSACTION_INERROR)
`3` | | `integer` | `[**PGSQL_TRANSACTION_UNKNOWN**](http://php.net/manual/en/class.pdo.php#pdo.constants.pgsql-transaction-unknown "Go to PHP documentation") ` | [#](https://api.legiscan.com/docs/class-PDO.html#PGSQL_TRANSACTION_UNKNOWN)
`4` | --- # Class Exception | LegiScan API Client [Overview](https://api.legiscan.com/docs/index.html "Overview") ### Packages * [LegiScan](https://api.legiscan.com/docs/package-LegiScan.html) * [API](https://api.legiscan.com/docs/package-LegiScan.API.html) * [Cache](https://api.legiscan.com/docs/package-LegiScan.Cache.html) * [Common](https://api.legiscan.com/docs/package-LegiScan.Common.html) * [Exceptions](https://api.legiscan.com/docs/package-LegiScan.Exceptions.html) * [Utility](https://api.legiscan.com/docs/package-LegiScan.Utility.html) * [PHP](https://api.legiscan.com/docs/package-PHP.html) * * * ### Classes * [PDO](https://api.legiscan.com/docs/class-PDO.html) * [PDOStatement](https://api.legiscan.com/docs/class-PDOStatement.html) ### Interfaces * [Traversable](https://api.legiscan.com/docs/class-Traversable.html) ### Exceptions * [Exception](https://api.legiscan.com/docs/class-Exception.html) * [PDOException](https://api.legiscan.com/docs/class-PDOException.html) * [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) * [Overview](https://api.legiscan.com/docs/index.html "Overview") * Package * Class Class Exception =============== #### Direct known subclasses [APIAccessException](https://api.legiscan.com/docs/class-APIAccessException.html) , [APIAuthTokenException](https://api.legiscan.com/docs/class-APIAuthTokenException.html) , [APIException](https://api.legiscan.com/docs/class-APIException.html) , [APIStatusException](https://api.legiscan.com/docs/class-APIStatusException.html) , [RuntimeException](https://api.legiscan.com/docs/class-RuntimeException.html) #### Indirect known subclasses [PDOException](https://api.legiscan.com/docs/class-PDOException.html) **PHP Extension:** [Core](http://php.net/manual/en "Go to PHP documentation") **Documented at** [php.net](http://php.net/manual/en/class.exception.php "Go to PHP documentation") | | | | --- | --- |Methods summary | `final private` | [#](https://api.legiscan.com/docs/class-Exception.html#___clone)
`[__clone](http://php.net/manual/en/exception.clone.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-Exception.html#___construct)
`[__construct](http://php.net/manual/en/exception.construct.php "Go to PHP documentation") ( $message, $code, $previous )` | | `public` | [#](https://api.legiscan.com/docs/class-Exception.html#___wakeup)
`[__wakeup](http://php.net/manual/en/exception.wakeup.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-Exception.html#_getMessage)
`[getMessage](http://php.net/manual/en/exception.getmessage.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-Exception.html#_getCode)
`[getCode](http://php.net/manual/en/exception.getcode.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-Exception.html#_getFile)
`[getFile](http://php.net/manual/en/exception.getfile.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-Exception.html#_getLine)
`[getLine](http://php.net/manual/en/exception.getline.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-Exception.html#_getTrace)
`[getTrace](http://php.net/manual/en/exception.gettrace.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-Exception.html#_getPrevious)
`[getPrevious](http://php.net/manual/en/exception.getprevious.php "Go to PHP documentation") ( )` | | `final public` | [#](https://api.legiscan.com/docs/class-Exception.html#_getTraceAsString)
`[getTraceAsString](http://php.net/manual/en/exception.gettraceasstring.php "Go to PHP documentation") ( )` | | `public` | [#](https://api.legiscan.com/docs/class-Exception.html#___toString)
`[__toString](http://php.net/manual/en/exception.tostring.php "Go to PHP documentation") ( )` | | | | | | --- | --- | --- |Properties summary | `protected string` | [$message](http://php.net/manual/en/class.exception.php#exception.props.message "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-Exception.html#$message)
`''` | | `private string` | [$string](http://php.net/manual/en/class.exception.php#exception.props.string "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-Exception.html#$string)
`''` | | `protected integer` | [$code](http://php.net/manual/en/class.exception.php#exception.props.code "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-Exception.html#$code)
`0` | | `protected` | [$file](http://php.net/manual/en/class.exception.php#exception.props.file "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-Exception.html#$file) | | `protected` | [$line](http://php.net/manual/en/class.exception.php#exception.props.line "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-Exception.html#$line) | | `private` | [$trace](http://php.net/manual/en/class.exception.php#exception.props.trace "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-Exception.html#$trace) | | `private` | [$previous](http://php.net/manual/en/class.exception.php#exception.props.previous "Go to PHP documentation") | [#](https://api.legiscan.com/docs/class-Exception.html#$previous) | ---