Download the PHP package cscfa_tool_division/csr3-dto without Composer

On this page you can find all versions of the php package cscfa_tool_division/csr3-dto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package csr3-dto

CSR3 Data Transfer Object

This project is the PHP implementation of the csr3 specification.

The data transfer objects are elements used to encapsulate the data when they must go through multiple elements of an application. The DTO acts as a container.

SensioLabsInsight

Basic usage

The CSR3 project define a generic DTO object :

The CSR3GenericDTO is an instance that implement CSR3DTOInterface. This interface extend ArrayAccess and Iterator interfaces.

The ArrayAccess iplementation

By using the ArrayAccess interface, the CSR3GenericDTO allow to be used as an array.

The Iterator iplementation

By using the Iterator interface, the CSR3GenericDTO allow to be used as an iterator.

The CSR3DTOInterface iplementation

The CSR3DTOInterface is the default access feature of the CSR3 DTOs. It allow to set and get attributes.

Adding custom methods

The CSR3GenericDTO is a final class and cannot be extended as it. But it extend an abstract class : the AbstractCSR3DTO that define all the logic needed to implement the CSR3DTOInterface.

Imagine you want to create a DTO that store a specific context and you want to be able to retreive this by a method call. You can create a DTO class as the following :

Using custom class properties

As seen in the custom method addition, you'll must create your own class :

The problem yu will discover by using this custom class is that the ArrayAccess and iterator property are not able to handle the $context property. To avoid this issue, you'll need to extend the AbstractCSR3PropertyDTO instead of the AbstractCSR3DTO.

:anger: Note the AbstractCSR3PropertyDTO is not able to process private properties as it. This is in fact the POO structure of the PHP.

Using private properties

To be able to manage the private properties of your DTO's, you'll must override three methods of the AbstractCSR3PropertyDTO :

:grey_exclamation: These three methods work in cooperation and cannot be override without the other to enable the fully private property support.

Internal key-words and how to override them

The AbstractCSR3DTO and AbstractCSR3PropertyDTO defines an attributes and traversingPosition properties. The first one store the attributes of the DTO, the second store the internal iteration pointer. It is possible to override them by setting a attributeContainer and a positionContainer properties that store the attributes names to use instead of the two initial properties.

:anger: The attributeContainer and positionContainer properties are key-words and cannot be overrides.

Using logic without CSR3 interfaces

The complete logic of this implementation is encapsulated inside a CSR3DTOTrait and a CSR3PropertyDTOTrait.


All versions of csr3-dto with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cscfa_tool_division/csr3-dto contains the following files

Loading the files please wait ....