ActivityCategory
in package
uses
IdentifiableTrait
Activity Category model.
Tags
Attributes
- #[Entity]
Table of Contents
Properties
- $activities : Collection<string|int, Activity>
- The Activities this Category belongs to.
- $id : int|null
- The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
- $name : ActivityLocalisedText
- Name for the Category.
Methods
- __construct() : mixed
- addActivity() : void
- getActivities() : array<string|int, Activity>
- getId() : int|null
- Get the identifier of the object.
- getName() : ActivityLocalisedText
- removeActivity() : void
- setId() : void
- Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
- setName() : void
- toArray() : ActivityCategoryArrayType
- toGdprArray() : ActivityCategoryGdprArrayType
Properties
$activities
The Activities this Category belongs to.
protected
Collection<string|int, Activity>
$activities
Attributes
- #[ManyToMany]
- $targetEntity: \Activity\Model\Activity::class
- $mappedBy: 'categories'
- $cascade: ['persist']
$id
The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
protected
int|null
$id
= null
Attributes
- #[Column]
- $type: 'integer'
- #[GeneratedValue]
- $strategy: 'IDENTITY'
- #[Id]
$name
Name for the Category.
protected
ActivityLocalisedText
$name
Attributes
- #[JoinColumn]
- $name: 'name_id'
- $referencedColumnName: 'id'
- $nullable: false
- #[OneToOne]
- $targetEntity: \Activity\Model\ActivityLocalisedText::class
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
Methods
__construct()
public
__construct() : mixed
addActivity()
public
addActivity(Activity $activity) : void
Parameters
- $activity : Activity
getActivities()
public
getActivities() : array<string|int, Activity>
Return values
array<string|int, Activity>getId()
Get the identifier of the object.
public
getId() : int|null
Tags
Return values
int|nullgetName()
public
getName() : ActivityLocalisedText
Return values
ActivityLocalisedTextremoveActivity()
public
removeActivity(Activity $activity) : void
Parameters
- $activity : Activity
setId()
Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
public
setId(int|null $id) : void
Parameters
- $id : int|null
setName()
public
setName(ActivityLocalisedText $name) : void
Parameters
- $name : ActivityLocalisedText
toArray()
public
toArray() : ActivityCategoryArrayType
Return values
ActivityCategoryArrayTypetoGdprArray()
public
toGdprArray() : ActivityCategoryGdprArrayType