Welcompose
[ class tree: Welcompose ] [ index: Welcompose ] [ all elements ]

Class: Content_GeneratorFormField

Source Location: /content_classes/generatorformfield.class.php

Class Overview




Variables

Methods



Class Details

[line 38]


[ Top ]


Class Variables

static $instance =  null

[line 45]

Singleton



Tags:

access:  public

Type:   object


[ Top ]

$base =  null

[line 52]

Reference to base class



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor __construct [line 59]

Content_GeneratorFormField __construct( )

Start instance of base class, load configuration and establish database connection. Please don't call the constructor direcly, use the singleton pattern instead.



Tags:

access:  public


[ Top ]

method addGeneratorFormField [line 85]

int addGeneratorFormField( array $sqlData)

Adds form field to the generator form fields table. Takes a field=>value array with form field data as first argument. Returns insert id.



Tags:

return:  Form field id
throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method countGeneratorFormFields [line 399]

array countGeneratorFormFields( [array $params = array()])

Method to count generator form fields. Takes key=>value array with select count as first argument. Returns array.

List of supported params:

  • form, int, optional: Form id




Tags:

throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deleteGeneratorFormField [line 160]

int deleteGeneratorFormField( int $id)

Removes generator form field from the generator form field table. Takes the generator form field id as first argument. Returns amount of affected rows.



Tags:

return:  Amount of affected rows
throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

int   $id   Generator form field id

[ Top ]

method generatorFormFieldBelongsToCurrentProject [line 592]

int generatorFormFieldBelongsToCurrentProject( int $generator_form_field)

Tests whether given generator form field belongs to current project. Takes the generator form id as first argument.

Returns bool.




Tags:

return:  bool
throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

int   $generator_form_field   Generator form field id

[ Top ]

method generatorFormFieldBelongsToCurrentUser [line 646]

bool generatorFormFieldBelongsToCurrentUser( int $generator_form_field)

Test whether generator form field belongs to current user or not.

Takes the generator form id as first argument. Returns bool.




Tags:

throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

int   $generator_form_field   Generator form field id

[ Top ]

method getTypeListForForm [line 467]

array getTypeListForForm( )

Returns list of available from field types for form definition.



Tags:

access:  public


[ Top ]

method selectGeneratorFormField [line 197]

array selectGeneratorFormField( int $id)

Selects a generator form field. Takes the generator form field id as first argument. Returns array with generator form field information.



Tags:

throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

int   $id   Generator form field id

[ Top ]

method selectGeneratorFormFields [line 282]

array selectGeneratorFormFields( [array $params = array()])

Method to select one or more generator form fields. Takes key=>value array with select params as first argument.

Returns array.

List of supported params:

  • form, int, optional: Form id
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return
  • order_marco, string, optional: How to sort the result set.
Supported macros:
  • NAME: sort by name
  • TYPE: sort by field type
</li>




Tags:

throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method testForUniqueName [line 510]

bool testForUniqueName( string $name, array $form_id_array)

Tests given generator field name for uniqueness. Takes the field name as first argument and an array consisting of form id and an optional field id as second argument. If the field id is given, this field won't be considered when checking for uniqueness (useful for updates).

Returns boolean true if field name is unique.

Sample for $form_id_array():

  1.  $form_id_array array(
  2.      'form' => $form,
  3.      'id' => $id
  4.  );




Tags:

throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

string   $name   Field name
array   $form_id_array   Form id and field id

[ Top ]

method updateGeneratorFormField [line 118]

int updateGeneratorFormField( int $id, array $sqlData)

Updates generator form field. Takes the generator form field id as first argument, a field=>value array with the new generator form data as second argument. Returns amount of affected rows.



Tags:

return:  Affected rows
throws:  Content_GeneratorFormFieldException
access:  public


Parameters:

int   $id   Generator form field id
array   $sqlData   Row data

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:50 +0100 by phpDocumentor 1.4.3