Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • Accounts
  • ApiKeys
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • ModuleClientMeta
  • ModuleManager
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • Taxes
  • Themes
  • Transactions
  • Users

Class States

States adhere to ISO 3166-2, and contain the native state/province/territory name. The format of ISO 3166-2 is [ISO 3166-1 alpha2 country code]-[subdivision code]. This model requires that the ISO 3166-2 code be split on the hyphen into its two parts.

Model
Extended by AppModel
Extended by States
Package: blesta\app\models
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/states.php

Methods summary

public
# __construct( )

Initialize States

Initialize States

Overrides

AppModel::__construct
public array
# getList( string $country = null, array $order_by = array("name" => "asc") )

List all states for a given country (ISO 3166-1 alpha2)

List all states for a given country (ISO 3166-1 alpha2)

Parameters

$country
string
$country The ISO 3166-1 alpha2 country code to fetch on
$order_by
string
$sort_by The field to sort on

Returns

array
An array of stdClass state objects
public mixed
# get( string $country, string $code )

Get a specific state/province/territory based ISO 3166-1 alpha2 country code and ISO 3166-2 subdivision code

Get a specific state/province/territory based ISO 3166-1 alpha2 country code and ISO 3166-2 subdivision code

Parameters

$country
string
$country The ISO 3166-1 alpha2 country code to fetch on
$code
string
$code The ISO 3166-2 alpha-numeric subdivision code

Returns

mixed
An stdClass object representing the state, or false if none exist
public
# add( array $vars )

Add a state

Add a state

Parameters

$vars
array
$vars An array of variable info including - code The ISO 3166-2 alpha-numeric subdivision code - country_alpha2 The ISO 3166-1 alpha2 country code - name The native language subdivision name
public
# edit( string $country, string $code, array $vars )

Edit a state by the ISO 3166-1 alpha2 country code and 3166-2 subdivision code

Edit a state by the ISO 3166-1 alpha2 country code and 3166-2 subdivision code

Parameters

$country
string
$country The ISO 3166-1 alpha2 country code
$code
string
$code The ISO 3166-2 subdivision code
$vars
array
$vars An array of variable info including - name The native language subdivision name
public
# delete( string $country, string $code )

Delete a state by the ISO 3166-1 alpha2 country code and 3166-2 subdivision code

Delete a state by the ISO 3166-1 alpha2 country code and 3166-2 subdivision code

Parameters

$country
string
$country The ISO 3166-1 alpha2 country code
$code
string
$code The ISO 3166-2 subdivision code

Methods inherited from AppModel

_(), boolToInt(), currencyToDecimal(), dateToUtc(), errors(), getPerPage(), ifSet(), loadCrypto(), setDefaultIfEmpty(), setPerPage(), setRulesIfSet(), strToBool(), systemDecrypt(), systemEncrypt(), systemHash(), truncateDecimal(), validateExists(), validateStateCountry()

Methods inherited from Model

affectedRows(), begin(), commit(), getConnection(), lastInsertId(), makeDSN(), prepare(), query(), rollBack(), setAttribute(), setFetchMode()

Magic methods summary

Properties summary

Properties inherited from AppModel

$replacement_keys

Blesta API documentation generated by ApiGen 2.8.0