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 Languages

Language management. Maintains all languages installed on the system and allows new languages to be installed.

All language codes are in ISO 639-1 ISO 3166-1 alpha-2 concatenated format (i.e. "en_us")

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

Methods summary

public
# __construct( )

Initialize Languages

Initialize Languages

Overrides

AppModel::__construct
public array
# getAll( integer $company_id )

Fetches all languages installed at the given company

Fetches all languages installed at the given company

Parameters

$company_id
integer
$company_id The ID of the company to fetch installed languages under.

Returns

array
An array of stdClass objects representing languages installed under the given company.
public array
# getAvailable( )

Get all available languages on the file system

Get all available languages on the file system

Returns

array
An array of key/value pairs representing languages available on the file system. Where the key is the language code and the value is the name of the language in its native form.
public
# add( integer $company_id, string $code )

Installs the given language file for the given company, if it exists

Installs the given language file for the given company, if it exists

Parameters

$company_id
integer
$company_id The ID of the company under which the language should be installed
$code
string
$code The language to install in ISO 639-1 ISO 3166-1 alpha-2 concatenated format (i.e. "en_us")
public
# delete( integer $company_id, string $code )

Uninstalls the given language

Uninstalls the given language

Parameters

$company_id
integer
$company_id The ID of the company to uninstall the given language from
$code
string
$code The language code under the given company to uninstall
public array
# getAllUninstallable( integer $company_id )

Retrieves a list of all languages that cannot be uninstalled for this company

Retrieves a list of all languages that cannot be uninstalled for this company

Parameters

$company_id
integer
$company_id The ID of the company whose uninstallable languages to fetch

Returns

array
A list of uninstallable languages
private string
# getNameFromFile( string $code )

Fetches the name of the language from the file system if the language exists and contains the language name file

Fetches the name of the language from the file system if the language exists and contains the language name file

Parameters

$code
string
$code The language code in ISO 639-1 ISO 3166-1 alpha-2 concatenated format (i.e. "en_us")

Returns

string
The name of the language from the language name file on the file system if it exists, else the $code.
public boolean
# validateCodeExists( string $code, integer $company_id )

Validates whether or not the $code and $company_id combination already exists

Validates whether or not the $code and $company_id combination already exists

Parameters

$code
string
$code The ISO 639-1 ISO 3166-1 alpha-2 code in concatenated format (i.e. "en_us")
$company_id
integer
$company_id The company ID

Returns

boolean
True if the $code and $company_id combination already exists, false otherwise
public boolean
# validateDefaultLang( string $code, integer $company_id )

Validates whether or not the $code and $company_id combination are the default language, or 'en_us'

Validates whether or not the $code and $company_id combination are the default language, or 'en_us'

Parameters

$code
string
$code The ISO 639-1 ISO 3166-1 alpha-2 code in concatenated format (i.e. "en_us")
$company_id
integer
$company_id The company ID

Returns

boolean
True if the $code and $company_id are the default language or 'en_us', false otherwise
private string
# getDefaultLang( mixed $company_id )

Fetches the default language code for this company

Fetches the default language code for this company

Returns

string
The language code (e.g. "en_us")

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