Neuron-PHP

Creator implements ICategoryCreator

Category creation service.

Creates new categories with slug generation.

Table of Contents

Interfaces

ICategoryCreator
Category creation service interface

Properties

$_categoryRepository  : ICategoryRepository
$_eventEmitter  : Emitter|null
$_slugGenerator  : SlugGenerator

Methods

__construct()  : mixed
create()  : Category
Create a new category from DTO
generateSlug()  : string
Generate URL-friendly slug from name

Properties

Methods

create()

Create a new category from DTO

public create(Dto $request) : Category
Parameters
$request : Dto

DTO containing name, slug, description

Tags
throws
Exception

If category creation fails

Return values
Category

generateSlug()

Generate URL-friendly slug from name

private generateSlug(string $name) : string

For names with only non-ASCII characters (e.g., "你好", "مرحبا"), generates a fallback slug using a unique identifier.

Parameters
$name : string
Return values
string

        
On this page

Search results