Category Entity
Last Updated: 2026-05-08
Category entities provide the organizational backbone for the Knowledge Hub. They group related knowledge items and define the scope for periodic digests.
Core Purpose
- Taxonomy: Logical grouping of knowledge items (e.g., "Backend", "Frontend", "HR")
- Digest Scope: Categories define which items are included in generated digests
- Notion Sync: Each category syncs bidirectionally with a Notion database entry
Entity Definition
- Location:
src/Entity/Category.php - Repository:
src/Repository/CategoryRepository.php - Table:
category
Properties
Core Properties
| Property | Type | Required | Description |
|---|---|---|---|
id | int | Auto | Primary key |
name | string | Yes | Category name (max 255 chars) |
description | string | No | Category description (max 255 chars) |
icon | string | No | Emoji icon (default: 📁) |
isActive | bool | No | Whether category is active (default: true) |
sortOrder | int | No | Display order (default: 0) |
createdAt | DateTimeImmutable | Auto | Creation timestamp (Gedmo) |
updatedAt | DateTimeImmutable | Auto | Update timestamp (Gedmo) |
Digest Settings
| Property | Type | Description |
|---|---|---|
digestEnabled | bool | Whether scheduled digests are active |
digestFrequency | string | Frequency enum: weekly, biweekly, monthly, quarterly |
lastDigestAt | DateTimeImmutable | When the last digest was generated |
digestDay | int | Day of week (1-7) for digest generation |
digestTime | string | Time of day (HH:MM) for digest generation |
Metadata
| Property | Type | Description |
|---|---|---|
targetGroups | array (JSON) | Target audience labels for this category |
Notion Integration
| Property | Type | Description |
|---|---|---|
notionId | string | Notion page ID for bidirectional sync |
lastSyncedAt | DateTimeImmutable | Last sync timestamp |
notionLastEditedAt | DateTimeImmutable | Last edit timestamp in Notion |
Relationships
Key Methods
Knowledge Management
php
$category->addKnowledge($knowledge); // Add item (sets inverse side)
$category->removeKnowledge($knowledge); // Remove item (clears inverse side)
$category->getKnowledges(); // Get all itemsActivation/Deactivation
php
$category->setIsActive(false); // Soft-delete: hides from Slack UIInactive categories are excluded from automatic sync cycles but preserve history for existing knowledge items.