Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Accounts
  • Actions
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CouponTerms
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • EmailVerifications
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • MessageGroups
  • Messages
  • MessengerManager
  • ModuleClientMeta
  • ModuleManager
  • ModuleTypes
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • ServiceInvoices
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • SystemEvents
  • Taxes
  • Themes
  • Transactions
  • Users
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

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 uses Blesta\Core\Util\Common\Traits\Container
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 = ['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
The ISO 3166-1 alpha2 country code to fetch on
$order_by

A set of key/value fields to order by where each key is the field and each value is the direction (optional, default name ascending)

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
The ISO 3166-1 alpha2 country code to fetch on
$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

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
The ISO 3166-1 alpha2 country code
$code
The ISO 3166-2 subdivision code
$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
The ISO 3166-1 alpha2 country code
$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 used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Properties inherited from AppModel
$logger, $replacement_keys
Blesta API documentation generated by ApiGen