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

Public Member Functions

 rules ()
 exists ($field)
 attributeLabels ()

Public Attributes

 $usersQty
 $likesQty
 $likesContentId
 $commentsQty
 $commentsForEach
 $commentsContentId

Detailed Description

Gentics Portal.Node PHP Author & Copyright (c) by Gentics Software GmbH sales.nosp@m.@gen.nosp@m.tics..nosp@m.com http://www.gentics.com Licenses can be found in the LICENSE.txt file in the root-folder of this installation You must not use this software without a valid license agreement.

UserGenerationForm class

Definition at line 13 of file GenerationForm.php.

Member Function Documentation

GenerationForm::attributeLabels ( )

Declares attribute labels.

Returns
array

Definition at line 74 of file GenerationForm.php.

References BulkModule\t().

{
return array(
'usersQty' => BulkModule::t("Users quantity"),
'likesQty' => BulkModule::t("Likes quantity"),
'commentsQty' => BulkModule::t("Comments quantity"),
'likesForEach' => BulkModule::t("For each user"),
'commentsForEach' => BulkModule::t("For each user"),
'likesContentId' => BulkModule::t("Content id"),
'commentsContentId' => BulkModule::t("Content id"),
);
}
GenerationForm::exists (   $field)

Checks if given contentId already exist

Parameters
string$fielddefines what field should be checked
Returns
bool

Definition at line 55 of file GenerationForm.php.

{
if ($field == 'likesContentId' && (!empty($this->likesQty) && empty($this->likesContentId))) {
$this->addError('likesContentId', 'Likes content id can\'t be empty');
return false;
}
if ($field == 'commentsContentId' && (!empty($this->commentsQty) && empty($this->commentsContentId))) {
$this->addError('likesContentId', 'Comments content id can\'t be empty');
return false;
}
return true;
}
GenerationForm::rules ( )

Declares the validation rules. The rules state that userQty is required and must be an integer,

Returns
array

Definition at line 37 of file GenerationForm.php.

{
return array(
// usersQty is required and must be an integer
array('usersQty, likesQty, commentsQty', 'numerical', 'integerOnly' => true),
array('commentsForEach', 'boolean'),
array('likesContentId, commentsContentId', 'length', 'max' => 255),
//array('likesContentId, commentsContentId', 'exists'),
);
}

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