star/identity

Library of classes that encapsulates identity concepts.

2.0.0 2022-10-16 15:30 UTC

This package is auto-updated.

Last update: 2024-11-16 20:06:38 UTC


README

Build Status

Description

This package defines an interface Star\Component\Identity\Identity to mark your object as entity.

It also includes some default implementations.

Usage

Installation

Run composer require star/identity using composer.

Identities

$integer = new IntegerId(4);
$string = new StringId('something');
$composite = new CompositeIdentity($integer, $string);

$integer->toString(); // return '4'
$string->toString(); // return 'something'
$composite->toString(); // return '4 something'

Exception

We also provide exception that comes bundled with messages for your identity.