Overview

Packages

  • akismet
  • None
  • PHP
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • plugins
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Signatures
    • Signed
    • Transport
  • wa-apps
    • blog
      • actions
        • backend
        • blog
        • comment
        • cron
        • design
        • frontend
        • page
        • plugin
        • post
      • api
        • v1
      • cli
      • layout
      • model
      • plugin
        • aksimet
        • category
        • emailsubscription
        • favorite
        • gravatar
        • import
        • markdown
        • myposts
        • tag
        • troll
      • settings
    • checklists
      • backend
      • json
    • contacts
      • backend
    • developer
    • dummy
    • guestbook
    • guestbook2
    • photos
      • album
      • api
        • v1
      • backend
      • design
      • dialog
      • frontend
      • page
      • photo
      • plugin
        • comment
        • imageeffects
        • import
        • publicgallery
        • watermark
      • search
      • settings
      • stack
      • tag
      • upload
    • site
      • backend
      • blocks
      • config
      • design
      • domains
      • files
      • frontend
      • helper
      • layout
      • pages
      • routing
      • setting
    • stickies
      • api
        • v1
      • sheet
      • stiky
  • wa-plugin
    • payment
    • shipping
    • sms
  • wa-plugins
    • shipping
      • usps
  • wa-system
    • API
    • Auth
      • Adapters
    • Autoload
    • Cache
      • Adapter
    • Captcha
    • Config
    • Contact
    • controller
    • currency
    • database
    • datetime
    • design
    • event
    • exception
    • files
    • image
    • layout
    • locale
    • log
    • mail
    • page
      • action
      • model
    • payment
    • plugin
    • request
    • response
    • routing
    • shipping
    • sms
    • storage
    • user
    • util
    • validator
    • view
    • webasyst
      • api
      • backend
      • cli
      • config
      • layout
      • login
      • model
      • password
      • payment
      • profile
      • settings
      • shipment
    • widget
    • workflow
  • waPlugins
    • Payment
  • webasyst
    • wa-system
      • helper

Classes

  • waContact
  • waContactAddressField
  • waContactAddressForMapFormatter
  • waContactAddressOneLineFormatter
  • waContactAddressSeveralLinesFormatter
  • waContactBirthdayField
  • waContactBirthdayJSFormatter
  • waContactBirthdayLocalFormatter
  • waContactBranchField
  • waContactCategoriesField
  • waContactCategoryStorage
  • waContactCheckboxField
  • waContactChecklistField
  • waContactCompositeField
  • waContactConditionalField
  • waContactCountryField
  • waContactCountryFormatter
  • waContactDataStorage
  • waContactDataTextStorage
  • waContactDateField
  • waContactDateLocalFormatter
  • waContactEmailField
  • waContactEmailListFormatter
  • waContactEmailStorage
  • waContactEmailTopFormatter
  • waContactField
  • waContactFieldFormatter
  • waContactFields
  • waContactForm
  • waContactHiddenField
  • waContactIMJSFormatter
  • waContactIMTopFormatter
  • waContactInfoStorage
  • waContactLocaleField
  • waContactLocaleFormatter
  • waContactNameField
  • waContactNumberField
  • waContactPasswordField
  • waContactPhoneField
  • waContactPhoneFormatter
  • waContactPhoneJsFormatter
  • waContactPhoneTopFormatter
  • waContactRadioSelectField
  • waContactRegionField
  • waContactsCollection
  • waContactSelectField
  • waContactSelectFormatter
  • waContactSocialNetworkJSFormatter
  • waContactSocialNetworkTopFormatter
  • waContactStorage
  • waContactStringField
  • waContactTextField
  • waContactTimezoneField
  • waContactUrlField
  • waContactUrlHtmlFormatter
  • waContactUrlJsFormatter
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class waContactField

This file is part of Webasyst framework.

Licensed under the terms of the GNU Lesser General Public License (LGPL). http://www.webasyst.com/framework/license/

Direct known subclasses

waContactBirthdayField, waContactCheckboxField, waContactCompositeField, waContactConditionalField, waContactDateField, waContactHiddenField, waContactPasswordField, waContactRegionField, waContactSelectField, waContactStringField

Indirect known subclasses

waContactAddressField, waContactBranchField, waContactRadioSelectField, waContactTextField, waContactTimezoneField, waContactUrlField, waContactCategoriesField, waContactChecklistField, waContactCountryField, waContactEmailField, waContactLocaleField, waContactNameField, waContactNumberField, waContactPhoneField
Abstract
Package: wa-system\Contact
Copyright: 2011 Webasyst LLC
License: LGPL
Author: Webasyst LLC
Link: http://www.webasyst.com/
Located at wa-system/contact/waContactField.class.php
Methods summary
public
# __construct( string $id, mixed $name, array $options = array() )

Constructor

Constructor

Because of a specific way this class is saved and loaded via var_dump, constructor parameters order and number cannot be changed in subclasses. Subclasses also must always provide a call to parent's constructor.

Parameters

$id
string
$id
$name
mixed
$name either a string or an array(locale => name)
$options
array
$options
protected
# init( )
public string
# getId( )

Returns id of the field

Returns id of the field

Returns

string
public
# getInfo( )
public string
# getName( string $locale = null, mixed $escape = false )

Returns name of the field

Returns name of the field

Parameters

$locale
string
$locale - locale
$escape

Returns

string
public
# isMulti( )
public
# isUnique( )
public
# isRequired( )
public
# isExt( )
public waContactStorage|string
# getStorage( boolean $name = null )

Parameters

$name
boolean
$name

Returns

waContactStorage|string
public
# get( waContact $contact, mixed $format = null )
public array
# set( waContact $contact, mixed $value, array $params = array(), boolean $add = false )

Prepare value to be stored in DB. Data returned will be validated and later passed to $this->getStorage()->set(). For non-multi fields return string or array(value=>string, ext=>string). For multi fields return list of arrays(value=>string, ext=>string); ext is optional, see $this->isExt()

Prepare value to be stored in DB. Data returned will be validated and later passed to $this->getStorage()->set(). For non-multi fields return string or array(value=>string, ext=>string). For multi fields return list of arrays(value=>string, ext=>string); ext is optional, see $this->isExt()

Parameters

$contact
waContact
$contact
$value
mixed
$value can be a string, an array(value=>..., ext=>...) or list of these.
$params
array
$params
$add
boolean
$add

Returns

array
protected mixed
# setValue( mixed $value )

Helper for $this->set() to format value of a field before inserting into DB (actually even before validation, so beware).

Helper for $this->set() to format value of a field before inserting into DB (actually even before validation, so beware).

$value is a single value passed to waContact['field_id'] via assignment. No extension, just the value, e.g.: 'a@b.com', not array('value' => 'a@b.com', 'ext' => 'work'). Note that for composite fields this behaves a little differently, see waContactCompositeField.

Parameters

$value
mixed
$value

Returns

mixed
possibly changed $value
public waValidator|null
# getValidator( )

Returns validator of the field

Returns validator of the field

Returns

waValidator|null
public array|string|null
# validateUnique( mixed $data, integer $contactId = null )

Check field value to be unique, if field is set up as unique.

Check field value to be unique, if field is set up as unique.

Parameters

$data
mixed
$data
$contactId
integer
$contactId

Returns

array|string|null
Validation errors (array for multi fields, string for simple fields) or null if everything is ok.
public array|string|null
# validate( mixed $data, integer $contact_id = null )

Validate field value and returns errors or null if value is valud

Validate field value and returns errors or null if value is valud

Parameters

$data
mixed
$data
$contact_id
integer
$contact_id

Returns

array|string|null
public
# format( mixed $data, mixed $format = null )
protected waContactFieldFormatter
# getFormatter( string $format )

Parameters

$format
string
$format

Returns

waContactFieldFormatter
public
# getField( )
public string
# getType( )

Returns

string
public array|null
# getParameter( mixed $p )

Get the current value of option $p. Used by a Field Constructor editor to access field parameters.

Get the current value of option $p. Used by a Field Constructor editor to access field parameters.

waContactField has one parameter: localized_names = array(locale => name)

Parameters

$p
mixed
$p string parameter to read

Returns

array|null
public
# setParameter( mixed $p, mixed $value )

Set the value of option $p. Used by a Field Constructor editor to change field parameters.

Set the value of option $p. Used by a Field Constructor editor to change field parameters.

localized_names = array(locale => name) required = boolean unique = boolean

Parameters

$p
mixed
$p string parameter to set
$value
mixed
$value mixed value to set
public
# getParameters( )
public
# setParameters( array $param )

Set array of parameters

Set array of parameters

Parameters

$param
array
$param parameter => value

Throws

waException
protected
# getHTMLName( mixed $params )
public
# getHtmlOne( mixed $params = array(), mixed $attrs = '' )
public
# getHtmlOneWithErrors( mixed $errors, mixed $params = array(), mixed $attrs = '' )
public
# getHTML( mixed $params = array(), mixed $attrs = '' )
public
# prepareVarExport( )
public static
# __set_state( mixed $state )
public
# prepareSave( mixed $value, waContact $contact = null )
Properties summary
protected mixed $id
#
protected array $options
#

Available options

array(
'export' => bool, // !!! never used?..
'sort' => bool, // ?..
'pa_hidden' => bool, // do not show in personal account
'pa_readonly' => bool, // show as read-only in personal acccount
'unique' => bool, // only allows unique values
'required' => bool, // is required in visual contact editor
'search' => bool, // ?..
'validator' => waValidator,
'storage' => waContactStorage,
'multi' => bool,
// for multi fields
'ext' => array(
'ext1' => 'ext1 Name',
...
),
// subfields for composite fields
'fields' => array(
new waContactField($sub_id, $sub_name, $sub_options),
...
),
// any options for specific field type
... )

Available options

array( 'export' => bool, // !!! never used?.. 'sort' => bool, // ?.. 'pa_hidden' => bool, // do not show in personal account 'pa_readonly' => bool, // show as read-only in personal acccount 'unique' => bool, // only allows unique values 'required' => bool, // is required in visual contact editor 'search' => bool, // ?.. 'validator' => waValidator, 'storage' => waContactStorage, 'multi' => bool, // for multi fields 'ext' => array( 'ext1' => 'ext1 Name', ... ), // subfields for composite fields 'fields' => array( new waContactField($sub_id, $sub_name, $sub_options), ... ), // any options for specific field type ... )

protected array $name array()
#

(locale => name)

(locale => name)

protected mixed $_type
#

used by __set_state()

used by __set_state()

My fork of Webasyst Framework API documentation generated by ApiGen 2.8.0