Download the PHP package jetcod/data-transport without Composer

On this page you can find all versions of the php package jetcod/data-transport. 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 data-transport

Data Transfer Object (DTO)

Actions Status

Latest Stable Version License

Overview

Data Transport is a PHP package that provides a simple and efficient way to transport data within your application. With Data Transport, you can easily define and manage your data structures, ensuring that your application's data is well-organized and easy to work with. Get started today and streamline your data transport process with Data Transport!

Check out our documentation for more details.

Installation

To install jetcod/data-transport, you can use Composer, the dependency manager for PHP. Run the following command in your terminal:

Usage

It is straightforward to employ jetcod/data-transport. To begin, create a customized data object class that extends Jetcod\DataTransport\AbstractDTO.

Next, construct your class and inject your array of data into it.

Alternatively, you can assign values to individual class attributes:

In addition to the traditional method of creating a class, you can also utilize the convenient make function to create instances of the class. The make function simplifies the process and provides an alternative way to initialize objects.

By utilizing the data transfer object, one can prevent the occurrence of exceptions when attempting to access an undefined class attribute. In such cases, the data transfer object will consistently return null.

Additionally, it offers the opportunity to specify custom data types.

Functions

The following functions are available in the DTO class:

__construct(?array $attributes = [])

The constructor function creates a new instance of the DTO class and initializes it with the given data array.

has(string $key): bool

The has() function checks if the specified key exists in the DTO class data and returns a boolean value.

It works the same as isset() php built-in function. For example if you have object:

then both functions will produce an identical outcome:

or

toArray()

The toArray() function returns an array representation of the DTO class data.

toJson(int $options = 0)

The toJson() function returns a JSON representation of the DTO class data.

Other than above functions, it has the following magic functions:

Function Description
__set(string $key, $val) sets the value of the specified attribute
__get(string $key) returns the value of the specified attribute
__isset(string $key) determines if the attribute has been set
__unset(string $key) unsets the specified attribute

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of data-transport with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
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 jetcod/data-transport contains the following files

Loading the files please wait ....