Skip to content

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 ​

PropertyTypeRequiredDescription
idintAutoPrimary key
namestringYesCategory name (max 255 chars)
descriptionstringNoCategory description (max 255 chars)
iconstringNoEmoji icon (default: 📁)
isActiveboolNoWhether category is active (default: true)
sortOrderintNoDisplay order (default: 0)
createdAtDateTimeImmutableAutoCreation timestamp (Gedmo)
updatedAtDateTimeImmutableAutoUpdate timestamp (Gedmo)

Digest Settings ​

PropertyTypeDescription
digestEnabledboolWhether scheduled digests are active
digestFrequencystringFrequency enum: weekly, biweekly, monthly, quarterly
lastDigestAtDateTimeImmutableWhen the last digest was generated
digestDayintDay of week (1-7) for digest generation
digestTimestringTime of day (HH:MM) for digest generation

Metadata ​

PropertyTypeDescription
targetGroupsarray (JSON)Target audience labels for this category

Notion Integration ​

PropertyTypeDescription
notionIdstringNotion page ID for bidirectional sync
lastSyncedAtDateTimeImmutableLast sync timestamp
notionLastEditedAtDateTimeImmutableLast 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 items

Activation/Deactivation ​

php
$category->setIsActive(false); // Soft-delete: hides from Slack UI

Inactive categories are excluded from automatic sync cycles but preserve history for existing knowledge items.