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

Class: Content_SimpleForm

Source Location: /content_classes/simpleform.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 ]

$_form_types = array(
      'PersonalForm',
      'BusinessForm',
   )

[line 59]

List of available form types



Tags:

access:  protected

Type:   array


[ Top ]



Class Methods


constructor __construct [line 69]

Content_SimpleForm __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 addSimpleForm [line 97]

int addSimpleForm( int $id, array $sqlData)

Adds simple form to the simple form table. Takes the page id as first argument, a field=>value array with simple form data as second argument. Returns insert id.



Tags:

return:  Simple form
throws:  Content_SimpleFormException
access:  public


Parameters:

int   $id   Page id
array   $sqlData   Row data

[ Top ]

method deleteSimpleForm [line 178]

int deleteSimpleForm( int $id)

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



Tags:

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


Parameters:

int   $id   Simple form id

[ Top ]

method isCustomFormType [line 479]

bool isCustomFormType( string $type)

Tests if given form type is a custom form type or not. Takes the actual form type string as first argument. Returns bool.



Tags:

access:  public


Parameters:

string   $type   Type

[ Top ]

method selectSimpleForm [line 215]

array selectSimpleForm( int $id)

Selects one simple form. Takes the simple form id as first argument. Returns array with simple form information.



Tags:

throws:  Content_SimpleFormException
access:  public


Parameters:

int   $id   Simple form id

[ Top ]

method selectSimpleForms [line 332]

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

Method to select one or more simple forms. Takes key=>value array with select params as first argument. Returns array.

List of supported params:

  • user, int, optional: User/author id
  • form, int, optional: Form id
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return
  • order_marco, string, otpional: How to sort the result set. Supported macros:
    • FORM: sorty by form id
    • DATE_MODIFIED: sorty by date modified
    • DATE_ADDED: sort by date added




Tags:

throws:  Content_SimpleFormException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method simpleFormBelongsToCurrentProject [line 496]

int simpleFormBelongsToCurrentProject( int $simple_form)

Tests whether given simple form belongs to current project. Takes the simple form id as first argument. Returns bool.



Tags:

return:  bool
throws:  Content_SimpleFormException
access:  public


Parameters:

int   $simple_form   Simple form id

[ Top ]

method simpleFormBelongsToCurrentUser [line 546]

bool simpleFormBelongsToCurrentUser( int $simple_form)

Test whether simple form belongs to current user or not. Takes the simple form id as first argument. Returns bool.



Tags:

throws:  Content_SimpleFormException
access:  public


Parameters:

int   $simple_form   Simple form id

[ Top ]

method updateSimpleForm [line 136]

int updateSimpleForm( int $id, array $sqlData)

Updates simple form. Takes the simple form id as first argument, a field=>value array with the new simple form data as second argument.

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Content_SimpleFormException
access:  public


Parameters:

int   $id   Simple form id
array   $sqlData   Row data

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:52:01 +0100 by phpDocumentor 1.4.3