Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | List of all members
FGForms Class Reference

Public Member Functions

 tableName ()
 rules ()
 relations ()
 defaultScope ()
 attributeLabels ()
 validateInput ($inputData=null)
 JSONToArray ()
 getElementFromJSONByName ($name)
 getElementLabel ($name)
 search ()
 searchAllForUser ($user_email=null)

Static Public Member Functions

static model ($className=__CLASS__)

Detailed Description

Definition at line 3 of file FGForms.php.

Member Function Documentation

FGForms::attributeLabels ( )
Returns
array customized attribute labels (name=>label)

Definition at line 60 of file FGForms.php.

{
return array(
'id' => 'ID',
'name' => 'Name',
'json' => 'Json',
'html' => 'Html',
'user' => 'User',
'creator_email' => 'Creator Email',
'salt' => 'Salt',
'thankyoupage' => 'Thankyoupage',
);
}
static FGForms::model (   $className = __CLASS__)
static

Returns the static model of the specified AR class.

Parameters
string$classNameactive record class name.
Returns
Forms the static model class

Definition at line 10 of file FGForms.php.

Referenced by FormController\loadModel().

{
return parent::model($className);
}
FGForms::relations ( )
Returns
array relational rules.

Definition at line 43 of file FGForms.php.

{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'formdata' => array(self::HAS_MANY, 'FGFormdata', 'form_id')
);
}
FGForms::rules ( )
Returns
array validation rules for model attributes.

Definition at line 26 of file FGForms.php.

{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('json, html', 'required'),
array('name, user thankyoupage', 'length', 'max'=>255),
array('salt', 'length', 'max'=>32),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, name, json, html, user, salt, creator_email thankyoupage nextpage prevpage', 'safe', 'on'=>'search'),
);
}
FGForms::search ( )

Retrieves a list of models based on the current search/filter conditions.

Returns
CActiveDataProvider the data provider that can return the models based on the search/filter conditions.

Definition at line 132 of file FGForms.php.

{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id,true);
$criteria->compare('name',$this->name,true);
$criteria->compare('json',$this->json,true);
$criteria->compare('html',$this->html,true);
$criteria->compare('user',$this->user,true);
$criteria->compare('salt',$this->salt,true);
// $criteria->compare('thankyoupage',$this->thankyoupage,true);
// $criteria->compare('nextpage',$this->nextpage,true);
// $criteria->compare('prevpage',$this->prevpage,true);
//if(FGModule::isUserAdmin() == false) {
// get only user records
//$criteria->compare('user', Yii::app()->user->id);
//}
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'Pagination'=>array(
'PageSize'=>40
)
));
}
FGForms::tableName ( )
Returns
string the associated database table name

Definition at line 18 of file FGForms.php.

{
return 'forms';
}

The documentation for this class was generated from the following file: