2017 © Pedro Peláez
 

library mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

image

multibytesystems/mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

  • Wednesday, May 16, 2018
  • by multibytesystems
  • Repository
  • 0 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 11 % Grown

The README.md

mb-components

This Zend module provides base classes to simplify handling of doctrine entities. Currently it consists of, (*1)

  • two abstract entity classes
  • one general repository class
  • one service class

Latest Version Total Downloads Software License, (*2)

Install

composer require multibytesystems/mb-components

Entity classes

  • MBBaseEntity simplifies handling of creation and modification date by providing a created and a modified property along with its accessor methods as well as appropriate lifecycleevent methods to set creation and modification date on persist and modification date on update. So this has not to be implemented in every entity class on it's own. In addition this class defines an abstract class getTextIdentifier() that is very similar to an getString() method and that should return a suitable string representation of the entity., (*3)

  • MBInterleavedChecksumEntity creates a simple checksum from provided record data as well as an interleaved checksum from provided record data alongside with data of the forerunning record (the predecessor). It defines an abstract method getInterityData() that needs to be implemented in the concrete entity class and returns an array of data that should be included within the checksum. This class also saves the id of it's predecessor into the current record., (*4)

Repository class

  • MBInterleavedChecksumEntityRepository provides the findLatest() method that returns the latest record within the corresponding table. Currently it does this by id (what means that this only works as intended if id is incremental).

Service class

  • IntegrityService provides the getValidatedEntities() method that returns a list of all entities with their validity checked. This result is similar to the repository's method findAll() but with validation and is needed as validation is a tiime consuming process and should not happen on every findAll()` operation.

Usage

To use MBBaseEntity add the following fields to the table that is related to the entity., (*5)

  • created (DateTime)
  • modified (DateTime)

Extend the MBBaseEntity within the concrete entity class. Add a getTextIdentifier() method to the concrete class that returns a suitable string representation of the entity., (*6)

To use MBInterleavedChecksumEntityRepository do everything that has to be done for using MBBaseEntity (this is because MBInterleavedChecksumEntityRepository extends MBBaseEntity) and add the following fields to the table that is related to the entity., (*7)

  • simple_checksum (varchar(1000))
  • interleaved_checksum (varchar(1000))
  • predecessor_id (int)

Extend the MBInterleavedChecksumEntityRepository within the concrete entity class. Add a getInterityData() method to the concrete class that returns an array of data that should be part of the simple and interleaved checksum., (*8)

The Versions

16/05 2018

dev-master

9999999-dev https://github.com/multibytesystems/mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

  Sources   Download

MIT

The Requires

 

zend doctrine entity

16/05 2018

1.2.2

1.2.2.0 https://github.com/multibytesystems/mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

  Sources   Download

MIT

The Requires

 

zend doctrine entity

01/05 2018

1.2.0

1.2.0.0 https://github.com/multibytesystems/mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

  Sources   Download

MIT

The Requires

 

zend doctrine entity

20/04 2018

1.1.2

1.1.2.0 https://github.com/multibytesystems/mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

  Sources   Download

MIT

The Requires

 

zend doctrine entity

20/04 2018

1.1.0

1.1.0.0 https://github.com/multibytesystems/mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

  Sources   Download

MIT

The Requires

 

zend doctrine entity

17/04 2018

1.0.0

1.0.0.0 https://github.com/multibytesystems/mb-components

Helper library to provide base functionality to common tasks when dealing with data driven applications

  Sources   Download

MIT

The Requires

 

zend doctrine entity