Documentation

Activity
in package

Table of Contents

Properties

$aclService  : AclService
$activityForm  : Activity
$categoryService  : ActivityCategory
$companyService  : Company
$emailService  : Email
$entityManager  : EntityManager
$organService  : Organ
$translator  : Translator

Methods

__construct()  : mixed
approve()  : void
Approve of an activity.
createActivity()  : bool
Create an activity from the creation form.
createSignupField()  : SignupField
Create a new field.
createSignupList()  : SignupList
Creates a SignupList for the specified Activity.
createUpdateProposal()  : bool
Create a new update proposal from user form.
disapprove()  : void
Disapprove of an activity.
getActivityForm()  : Activity
Return activity creation form.
reset()  : void
Reset the approval status of an activity.
revokeUpdateProposal()  : void
Revoke a proposed activity update NB: This action permanently removes the proposal, so this cannot be undone.
updateActivity()  : void
Apply a proposed activity update.
arrayDiffAssocRecursive()  : array<string|int, mixed>
`array_diff_assoc` but recursively. Used to compare an update proposal of an activity to the original activity.
arrayFilterRecursive()  : array<string|int, mixed>
`array_filter` but recursively. Used to compare an update proposal of an activity to the original activity.
canApplyUpdateProposal()  : bool
Checks whether the current user is allowed to apply an update proposal for the given activity.
createSignupOption()  : void
Creates options for both languages specified and adds it to $field.
findOrgan()  : Organ
Find the organ the activity belongs to, and see if the user has permission to create an activity for this organ.
isUpdateProposalNew()  : bool
Check if an update proposal is actually an update.
recursiveUnsetKey()  : void
Recursively unset a key in an array (by reference).
saveActivityData()  : Activity
Create an activity from parameters.
requestGEFLITST()  : void

Properties

$entityManager read-only

private EntityManager $entityManager

$translator read-only

private Translator $translator

Methods

createActivity()

Create an activity from the creation form.

public createActivity(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>

Parameters describing activity

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
bool

activity that was created

createSignupField()

Create a new field.

public createSignupField(array<string|int, mixed> $data, SignupList $signupList) : SignupField
Parameters
$data : array<string|int, mixed>

parameters for the new field

$signupList : SignupList

the SignupList the field belongs to

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
SignupField

the new field

createSignupList()

Creates a SignupList for the specified Activity.

public createSignupList(array<string|int, mixed> $data, Activity $activity) : SignupList
Parameters
$data : array<string|int, mixed>
$activity : Activity
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
SignupList

createUpdateProposal()

Create a new update proposal from user form.

public createUpdateProposal(Activity $currentActivity, array<string|int, mixed> $data) : bool
Parameters
$currentActivity : Activity
$data : array<string|int, mixed>
Tags
throws
ORMException
throws
OptimisticLockException
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
bool

indicating whether the update was applied or is pending

reset()

Reset the approval status of an activity.

public reset(Activity $activity) : void
Parameters
$activity : Activity

revokeUpdateProposal()

Revoke a proposed activity update NB: This action permanently removes the proposal, so this cannot be undone.

public revokeUpdateProposal(ActivityUpdateProposal $proposal) : void

(The potentially updated activity remains untouched).

Parameters
$proposal : ActivityUpdateProposal

arrayDiffAssocRecursive()

`array_diff_assoc` but recursively. Used to compare an update proposal of an activity to the original activity.

protected arrayDiffAssocRecursive(array<string|int, mixed> $array1, array<string|int, mixed> $array2) : array<string|int, mixed>

Adapted from https://www.php.net/manual/en/function.array-diff-assoc.php#usernotes.

Parameters
$array1 : array<string|int, mixed>
$array2 : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

phpcsSuppress

SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification

Return values
array<string|int, mixed>

arrayFilterRecursive()

`array_filter` but recursively. Used to compare an update proposal of an activity to the original activity.

protected arrayFilterRecursive(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

phpcsSuppress

SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification

Return values
array<string|int, mixed>

canApplyUpdateProposal()

Checks whether the current user is allowed to apply an update proposal for the given activity.

protected canApplyUpdateProposal(Activity $activity) : bool
Parameters
$activity : Activity
Return values
bool

indicating whether the update may be applied

createSignupOption()

Creates options for both languages specified and adds it to $field.

protected createSignupOption(array<string|int, mixed> $data, SignupField $field) : void

If no languages are specified, this method does nothing.

Parameters
$data : array<string|int, mixed>

the array containing the options strings

$field : SignupField

the field to add the options to

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

findOrgan()

Find the organ the activity belongs to, and see if the user has permission to create an activity for this organ.

protected findOrgan(int $organId) : Organ
Parameters
$organId : int

The id of the organ associated with the activity

Tags
throws
NotAllowedException

if the user is not a member of the organ specified.

Return values
Organ

The organ associated with the activity, if the user is a member of that organ

isUpdateProposalNew()

Check if an update proposal is actually an update.

protected isUpdateProposalNew(array<string|int, mixed> $current, array<string|int, mixed> $proposal) : bool
Parameters
$current : array<string|int, mixed>
$proposal : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
bool

recursiveUnsetKey()

Recursively unset a key in an array (by reference).

protected recursiveUnsetKey(array<string|int, mixed> &$array, string $key) : void
Parameters
$array : array<string|int, mixed>
$key : string
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

saveActivityData()

Create an activity from parameters.

protected saveActivityData(array<string|int, mixed> $data, Member $user, Organ|null $organ, Company|null $company, int $status) : Activity
Parameters
$data : array<string|int, mixed>

Parameters describing activity

$user : Member

The user that creates this activity

$organ : Organ|null

The organ this activity is associated with

$company : Company|null

The company this activity is associated with

$status : int
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
Activity

activity that was created


        
On this page

Search results