Primordyx Framework Documentation

StateInfo
in package
implements JsonSerializable

Class StateInfo

This class represents a state or territory, encapsulating various data attributes related to it. The data is expected to be passed as an associative array, and the object can be easily serialized to JSON.

Tags
since
1.0.0

Table of Contents

Interfaces

JsonSerializable

Properties

$abbreviation  : string
$admitted  : int|null
$bird  : string
$borders  : array<string|int, mixed>
$capital  : string
$constitutionalOrder  : int|null
$culturalRegion  : string
$fips  : string
$flower  : string
$hasDST  : bool
$hasRON  : bool
$isContiguous  : bool
$isoCode  : string
$isOriginal13  : bool
$isState  : bool
$motto  : string
$name  : string
$nickname  : string
$region  : string
$statehoodCategory  : string
$timezone  : string
$timezoneAbbr  : array<string|int, mixed>
$timezoneOffset  : array<string|int, mixed>
$tree  : string

Methods

__construct()  : mixed
Constructor for the StateInfo class.
jsonSerialize()  : array<string|int, mixed>
Implements JsonSerializable to convert to JSON easily.

Properties

$abbreviation

public string $abbreviation

The abbreviation of the state (e.g., 'TX', 'CA')

$admitted

public int|null $admitted

The year the state was admitted to the Union or null for territories

$bird

public string $bird

The state bird (e.g., 'Northern Mockingbird')

$borders

public array<string|int, mixed> $borders

An array of state abbreviations that border this state (e.g., ['TX', 'OK', 'AR'])

$capital

public string $capital

The capital city of the state (e.g., 'Austin', 'Sacramento')

$constitutionalOrder

public int|null $constitutionalOrder

The state's constitutional order of ratification or null for territories

$culturalRegion

public string $culturalRegion

The cultural region to which the state belongs (e.g., 'Deep South', 'New England')

$fips

public string $fips

The FIPS code for the state (e.g., '48' for Texas)

$flower

public string $flower

The state flower (e.g., 'Bluebonnet')

$hasDST

public bool $hasDST

True if the state observes Daylight Saving Time (DST)

$hasRON

public bool $hasRON

True if the state allows Remote Online Notarization (RON)

$isContiguous

public bool $isContiguous

True if the state is part of the contiguous 48 states

$isoCode

public string $isoCode

The ISO 3166-2 code for the state (e.g., 'US-TX')

$isOriginal13

public bool $isOriginal13

True if the state was one of the original 13 colonies, false otherwise

$isState

public bool $isState

True if this is a state, false for territories

$motto

public string $motto

The state motto (e.g., 'Friendship', 'Eureka')

$name

public string $name

The full name of the state (e.g., 'Texas', 'California')

$nickname

public string $nickname

The official nickname of the state (e.g., 'The Lone Star State', 'The Golden State')

$region

public string $region

The region of the state (e.g., 'South', 'West', 'Midwest')

$statehoodCategory

public string $statehoodCategory

The category of statehood: 'Original Colony', 'Pre-Civil War', 'Post-Civil War', etc.

$timezone

public string $timezone

The primary timezone of the state (e.g., 'Central', 'Pacific')

$timezoneAbbr

public array<string|int, mixed> $timezoneAbbr

The timezone abbreviations for standard and daylight time (e.g., ['standard' => 'CST', 'daylight' => 'CDT'])

$timezoneOffset

public array<string|int, mixed> $timezoneOffset

The timezone offsets for standard and daylight time (e.g., ['standard' => '-06:00', 'daylight' => '-05:00'])

$tree

public string $tree

The state tree (e.g., 'Pecan')

Methods

__construct()

Constructor for the StateInfo class.

public __construct(array<string|int, mixed> $info) : mixed

Initializes the state information based on the passed array.

Parameters
$info : array<string|int, mixed>

An associative array containing the state or territory data.

jsonSerialize()

Implements JsonSerializable to convert to JSON easily.

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of the state data suitable for JSON encoding.


        
On this page

Search results