Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cContentTypePifaForm
  • DefaultFormModule
  • DefaultFormProcessor
  • ExampleOptionsDatasource
  • MailedFormProcessor
  • Pifa
  • PifaAbstractFormModule
  • PifaAbstractFormProcessor
  • PifaAjaxHandler
  • PifaExternalOptionsDatasourceInterface
  • PifaField
  • PifaFieldCollection
  • PifaForm
  • PifaFormCollection
  • PifaLeftBottomPage
  • PifaRightBottomFormDataPage
  • PifaRightBottomFormFieldsPage
  • PifaRightBottomFormPage
  • SolrRightBottomPage

Exceptions

  • PifaDatabaseException
  • PifaException
  • PifaIllegalStateException
  • PifaMailException
  • PifaNotImplementedException
  • PifaNotYetStoredException
  • PifaValidationException
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class PifaForm

contains meta data of PIFA forms

cGenericDb
Extended by cItemBaseAbstract
Extended by Item
Extended by PifaForm
Package: Plugin\FormAssistant
Copyright: four for business AG
Author: marcus.gnass
Located at plugins/form_assistant/classes/class.pifa.form.php
Methods summary
public
# __construct( mixed $id = false )

Parameters

$id
mixed
$id ID of item to be loaded or false

Throws

cInvalidArgumentException
If table name or primary key is not set

Overrides

Item::__construct()
public array
# getErrors( )

Returns

array
public
# setErrors( array $_errors )

Parameters

$_errors
array
$_errors
public array:PifaField
# getFields( )

Returns

array:PifaField
public mixed
# getLastInsertedId( )

Returns

mixed
$_lastInsertedId
public
# setLastInsertedId( integer $_lastInsertedId )

Parameters

$_lastInsertedId
integer
$_lastInsertedId
public array
# getValues( )

Returns an array containing values of all fields of this form where the fields column name is used as key.

Returns an array containing values of all fields of this form where the fields column name is used as key.

Returns

array
public
# setValues( array $values = NULL, boolean $clear = false )

Sets values for this form fields.

Sets values for this form fields.

The given data array is searched for keys corresponding to this form field names. Other values are omitted. This method is meant to be called with the $_GET or $_POST superglobal variables. Validation is performed according to the specifications defined for aech form field.

Parameters

$values
array
$data
$clear
boolean
$clear if missing values should be interpreted as NULL
public array:mixed
# getFiles( )

Returns an array containing uploaded files of all fields of this form where the fields column name is used as key.

Returns an array containing uploaded files of all fields of this form where the fields column name is used as key.

Returns

array:mixed
public
# setFiles( array $files = NULL )

Sets uploaded file(s) for appropriate form fields.

Sets uploaded file(s) for appropriate form fields.

public
# getLastError( )

Getter for protected prop.

Getter for protected prop.

public
# fromForm( )
public string
# toHtml( array $opt = NULL )

Returns HTML for this form that should be displayed in frontend.

Returns HTML for this form that should be displayed in frontend.

Parameters

$opt
array
$opt to determine form attributes

Returns

string
public
# validate( )

Loops all fields and checks their value for being obligatory and conforming to the fields rule.

Loops all fields and checks their value for being obligatory and conforming to the fields rule.

Throws

PifaValidationException
if at least one field was invalid
public boolean
# store( )

Stores the loaded and modified item to the database.

Stores the loaded and modified item to the database.

In contrast to its parent method this store() method returns true even if there were no modiifed values and thus no statement was executed. This helps in handling database errors.

Returns

boolean

Todo

Check if method store() should be implemented for PifaField too.

Overrides

Item::store()
public
# storeData( )

Stores values of each field of this form in defined data table. For fields of type INPUT_FILE the uploaded file is stored in the FileSystem (in $cfg['path']['contenido_cache'] . 'form_assistant/').

Stores values of each field of this form in defined data table. For fields of type INPUT_FILE the uploaded file is stored in the FileSystem (in $cfg['path']['contenido_cache'] . 'form_assistant/').

Throws

PifaDatabaseException
if values could not be stored
public
# toMailRecipient( array $opt )

Parameters

$opt
array
$opt
public array
# getData( )

Returns

array

Throws

PifaException
if form is not loaded
PifaException
if table does not exist
public
# getDataAsCsv( string $optionally = 'OPTIONALLY' )

Echoes a CSV file containing all of this forms stored data. Thatfor proper headers are sent, that add the created file as attachment for easier download.

Echoes a CSV file containing all of this forms stored data. Thatfor proper headers are sent, that add the created file as attachment for easier download.

Parameters

$optionally
string
$optionally

Throws

PifaException
if form is not loaded
PifaException
if table does not exist
private
# _getCsvFromLocalDatabaseServer( string $optionally = 'OPTIONALLY' )

Parameters

$optionally
string
$optionally

Throws

PifaException
if form is not loaded
PifaException
if table does not exist
private
# _getCsvFromRemoteDatabaseServer( )

TODO use fputcsv()

TODO use fputcsv()

Throws

PifaException
if form is not loaded
PifaException
if table does not exist
public
# getCsv( boolean $oneRowPerField = false, array $additionalFields = NULL )

This method returns the current data as CSV file. This file usually contains two rows, one header and one value line. If $oneRowPerField is set to true the CSV-file is mirrored so that each line contains the fields header and then its value. An assoc array of $additionalFields can be given which will be appended th the current values of this form.

This method returns the current data as CSV file. This file usually contains two rows, one header and one value line. If $oneRowPerField is set to true the CSV-file is mirrored so that each line contains the fields header and then its value. An assoc array of $additionalFields can be given which will be appended th the current values of this form.

Parameters

$oneRowPerField
boolean
$oneRowPerField
$additionalFields
public
# existsTable( mixed $tableName, mixed $bySchema = false )

Throws

PifaException
if existance of table could not be determined

See

http://www.electrictoolbox.com/check-if-mysql-table-exists/
public
# createTable( mixed $withTimestamp )

Throws

PifaException
if form is not loaded
PifaException
if existance of table could not be determined
PifaException
if table already exists
PifaException
if table could not be created
public
# alterTable( string $oldTableName, boolean $oldWithTimestamp )

Alter data table. Renames data table if name has changed and adds or drops column for timestamp if setting has changed.

Alter data table. Renames data table if name has changed and adds or drops column for timestamp if setting has changed.

HINT: passing the old values is correct! The new values have already been stored inside the pifaForm object!

Parameters

$oldTableName
string
$oldTableName
$oldWithTimestamp
boolean
$oldWithTimestamp

Throws

PifaException
if form is not loaded
public
# storeColumn( PifaField $pifaField, string $oldColumnName )

Parameters

$pifaField
PifaField
$pifaField
$oldColumnName
string
$oldColumnName

Throws

PifaException
if form is not loaded
PifaException
if field is not loaded
public
# changeColumn( string $columnName, string $dataType, string $oldColumnName )

rename column if name has changed

rename column if name has changed

Parameters

$columnName
string
$columnName
$dataType
string
$dataType
$oldColumnName
string
$oldColumnName

Throws

PifaException
if column already exists
PifaException
if column could not be changed
public
# dropColumn( string $columnName )

Adds a column for the current field to the table of the current form.

Adds a column for the current field to the table of the current form.

Parameters

$columnName
string
$columnName

Throws

PifaException
if column already exists
public
# addColumn( string $columnName, string $dataType )

Adds a column for the current field to the table of the current form.

Adds a column for the current field to the table of the current form.

Parameters

$columnName
string
$columnName
$dataType
string
$dataType

Throws

PifaException
if field is not loaded
protected boolean
# _existsColumn( string $columnName )

Parameters

$columnName
string
$columnName

Returns

boolean

Throws

PifaException
if columns could not be read
public
# delete( )

Deletes this form with all its fields and stored data. The forms data table is also dropped.

Deletes this form with all its fields and stored data. The forms data table is also dropped.

public
# getTableName( )

Deprecated

use $this->get('data_table') instead
Methods inherited from Item
_inFilter(), _loadByWhereClause(), _onLoad(), _outFilter(), _setMetaObject(), deleteProperty(), deletePropertyById(), get(), getField(), getMetaObject(), getProperty(), isLoaded(), loadBy(), loadByMany(), loadByPrimaryKey(), loadByRecordSet(), set(), setField(), setFilters(), setProperty(), toArray(), toObject()
Methods inherited from cItemBaseAbstract
_getPropertiesCollectionInstance(), _getSecondDBInstance(), escape()
Methods inherited from cGenericDb
_executeCallbacks(), register(), unregister()
Constants inherited from cGenericDb
CREATE_BEFORE, CREATE_FAILURE, CREATE_SUCCESS, DELETE_BEFORE, DELETE_FAILURE, DELETE_SUCCESS, STORE_BEFORE, STORE_FAILURE, STORE_SUCCESS
Properties summary
private array $_fields NULL
#

aggregated collection of this form fields

aggregated collection of this form fields

private array $_errors array()
#

array of errors with field names as keys and error messages as values

array of errors with field names as keys and error messages as values

private integer $_lastInsertedId NULL
#

lastInsertedId

lastInsertedId

Properties inherited from Item
$_arrInFilters, $_arrOutFilters, $_lastSQL, $_metaObject, $modifiedValues, $oldPrimaryKey, $values
Properties inherited from cItemBaseAbstract
$_className, $_oCache, $_settings, $db, $lasterror, $primaryKey, $properties, $secondDb, $table, $virgin
CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0