2017 © Pedro Peláez
 

library entity

A set of Entity assistance components

image

crudle/entity

A set of Entity assistance components

  • Monday, October 24, 2016
  • by crudle-apps
  • Repository
  • 2 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Entity - A package to help make entities easier

This package contains various things like traits for private immutable attributes, and making entities identifiable with UUID's., (*1)

Installation

composer require crudle/entity

Example Usage

use Crudle\Entity\Identity\IdentifiedByUuid;
use Crudle\Entity\Property\PrivateImmutableAttributes;

class MyEntity
{
    use IdentifiedByUuid, PrivateImmutableAttributes;

    /**
     * @param string $description
     * @return MyEntity
     */
    public function setDescription(string $description): MyEntity
    {
        return $this->set('description', $description);
    }

    /**
     * @return string
     * @throws \Crudle\Entity\Exception\UndefinedException
     *  When a description has not yet been set
     */
    public function getDescription(): string
    {
        return $this->getOrFail('description');
    }
}

$myEntity = new MyEntity;
$myEntity->getId(); // Crudle\Entity\Identity\Uuid

$myOtherEntity = new MyEntity('fa8588c6-166d-400d-9b13-561704027e94');

The Versions

24/10 2016

dev-master

9999999-dev

A set of Entity assistance components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nathan King

24/10 2016

v1.0

1.0.0.0

A set of Entity assistance components

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nathan King