Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Accounts
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • ModuleManager
  • Navigation
  • PackageGroups
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • 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, string $sort_by = "name", string $order = "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
$sort_by
string
$sort_by The field to sort on
$order
string
$order The order to sort (asc, desc)

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 -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
# 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
private array
# getRules( array $vars )

Returns the rule set for adding/editing states

Returns the rule set for adding/editing states

Parameters

$vars
array
$vars An array of state info including: -code The state code -country_alpha2 The 2-character country code ISO 3166-2 -name The name of the state in its native language

Returns

array
State rules

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