All Data Structures Functions Variables Pages
Static Public Member Functions | Static Protected Member Functions
GroupUserMembershipFormUtil Class Reference

Static Public Member Functions

static typeCastPostData ($postData)
 
static makeFormFromGroup ($group)
 
static validateMembershipChange (GroupUserMembershipForm $form, Group $group)
 
static setMembershipFromForm ($form, $group)
 
static setFormFromCastedPost (GroupUserMembershipForm $membershipForm, array $postData)
 

Static Protected Member Functions

static makeUserMembershipDataFromUsers ($users)
 
static makeUsersFromUserMembershipData (array $userData)
 
static makeNonUserMembershipDataFromUserMembershipData (array $userData)
 

Detailed Description

Helper class to create a form from a group's membership data. Also allows for setting membership on a group from a form.

Definition at line 42 of file GroupUserMembershipFormUtil.php.

Member Function Documentation

static typeCastPostData (   $postData)
static

Used to properly type cast incoming POST data

Definition at line 47 of file GroupUserMembershipFormUtil.php.

static makeFormFromGroup (   $group)
static
Parameters
$group
Returns
GroupUserMembershipForm

Definition at line 64 of file GroupUserMembershipFormUtil.php.

static validateMembershipChange ( GroupUserMembershipForm  $form,
Group  $group 
)
static
Parameters
GroupUserMembershipForm$form
Group$group
Returns
null|string $message. If message present than validation failed.

Definition at line 82 of file GroupUserMembershipFormUtil.php.

static setMembershipFromForm (   $form,
  $group 
)
static

Takes post data and prepares it for setting the membership on the group. Adds and removes users to group based on a form's userMembershipData

Parameters
$form
$group
Returns
boolean. True if membership was set successfully.

Definition at line 107 of file GroupUserMembershipFormUtil.php.

static setFormFromCastedPost ( GroupUserMembershipForm  $membershipForm,
array  $postData 
)
static

Set the userMembershipData attribute on the GroupUserMembershipForm

Parameters
GroupUserMembershipForm$membershipForm
array$postData
Returns
GroupUserMembershipForm

Definition at line 159 of file GroupUserMembershipFormUtil.php.


The documentation for this class was generated from the following file:
Generated on Fri Jun 5 2020 07:10:49