Public Member Functions | Public Attributes | Protected Attributes

Card Class Reference

Addressbook card model. More...

Inheritance diagram for Card:
BEAppObjectModel BEAppModel AppModel

List of all members.

Public Member Functions

 beforeValidate ()
 beforeSave ()
 afterSave ($created)
 importCSVFile ($csvFile, array $options=null)
 Import a Microsoft Outlook/Outlook Express CSV file.
 headerCSV (array $options=null)
 Get Microsoft Outlook CSV header or custom CSV header.
 exportCSV (array $options=null, array $data=array())
 Export model data to Microsoft Outlook CSV format or custom CSV format.
 createCsvAsString (array $data, array $options=null)
 Generate CSV file content as string from cards data array.
 importVCardFile ($cardFile, array $options=null)
 Import a vCard/vcf file.
 exportVCard (array $data=null)
 Export model data to VCard format.

Public Attributes

 $searchFields
 $actsAs
 $objectTypesGroups = array("leafs", "related")
 $hasAndBelongsToMany
 $validate
const DEFAULT_CSV_DELIMITER = ','

Protected Attributes

 $modelBindings

Detailed Description

Addressbook card model.

Definition at line 26 of file card.php.


Member Function Documentation

Card::createCsvAsString ( array $  data,
array $  options = null 
)

Generate CSV file content as string from cards data array.

Parameters:
array $options, may contain

  • 'delimiter' => '<char delimiter="" to="" use>="">' default is ','
  • 'custom' => true (use custom format) default false
array $data, object data to export
Returns:
string, requested CSV content

Definition at line 427 of file card.php.

References exportCSV(), and headerCSV().

Card::exportCSV ( array $  options = null,
array $  data = array() 
)

Export model data to Microsoft Outlook CSV format or custom CSV format.

Parameters:
array $options, may contain

  • 'delimiter' => '<char delimiter="" to="" use>="">' default is ','
  • 'custom' => true (use custom format) default false
array $data, object data to export
Returns:
string, single line as string

Definition at line 386 of file card.php.

Referenced by createCsvAsString().

Card::exportVCard ( array $  data = null  ) 

Export model data to VCard format.

Parameters:
array,data to export - if missing current data are loaded, using $this->id

Definition at line 494 of file card.php.

Card::headerCSV ( array $  options = null  ) 

Get Microsoft Outlook CSV header or custom CSV header.

Parameters:
array $options, may contain

  • 'delimiter' => '<char delimiter="" to="" use>="">' default is ','
  • 'custom' => true (use custom format) default false
Returns:
string, single line as string

Definition at line 348 of file card.php.

Referenced by createCsvAsString().

Card::importCSVFile ( csvFile,
array $  options = null 
)

Import a Microsoft Outlook/Outlook Express CSV file.

Parameters:
string $csvFile, path to csv file file
array $options, default attributes/array to use, e.g. categories, 'Category' => array (1,3,4..) - array of id-categories 'overwritePolicy' - card with same email exists, values = 'skip'(default), 'overwrite', 'new'
Returns:
results array, num of objects saved ('numSaved') and other data

Definition at line 210 of file card.php.

References BEAppObjectModel::field().

Card::importVCardFile ( cardFile,
array $  options = null 
)

Import a vCard/vcf file.

Parameters:
string $cardFile, path to vcard file
array $options, default attributes array to use, e.g. categories, "Category" => array (1,3,4..) - array of id-categories
Returns:
results array, num of objects saved ("numSaved") and other data

Definition at line 443 of file card.php.


Member Data Documentation

Card::$actsAs
Initial value:
 array(
            'CompactResult'         => array("MailGroup", "GeoTag")
    )

Reimplemented from BEAppObjectModel.

Definition at line 41 of file card.php.

Card::$hasAndBelongsToMany
Initial value:
 array(
            "MailGroup" => array(
                            "joinTable" => "mail_group_cards",
                            "with" => "MailGroupCard"
                        )
        )

Definition at line 95 of file card.php.

Card::$searchFields
Initial value:
 array(
        "title" => 10,
        "nickname" => 8,
        "description" => 4,
        "website" => 6,
        "email" => 6,
        "email2" => 5,
        "street_address" => 3,
        "company_name" => 3,
        "city" => 4,
        "note" => 2
    )

Definition at line 28 of file card.php.

Card::$validate
Initial value:
 array(
        'email' => array(
            'rule' => 'email',
            'allowEmpty' => true,
            'message' => 'Please supply a valid email address.'
        ),
        'email2' => array(
            'rule' => 'email',
            'allowEmpty' => true,
            'message' => 'Please supply a valid email address.'
        ),
        'newsletter_email' => array(
            'rule' => 'email',
            'allowEmpty' => true,
            'message' => 'Please supply a valid email address.'
        )
    )

Definition at line 104 of file card.php.


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus