Download the PHP package joomla/data without Composer

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

The Data Package Build Status

Latest Stable Version Total Downloads Latest Unstable Version License

Data\DataObject

Data\DataObject is a class that is used to store data but allowing you to access the data by mimicking the way PHP handles class properties. Rather than explicitly declaring properties in the class, Data\DataObject stores virtual properties of the class in a private internal array. Concrete properties can still be defined but these are separate from the data.

Construction

The constructor for a new Data\DataObject object can optionally take an array or an object. The keys of the array or the properties of the object will be bound to the properties of the Data\DataObject object.

General Usage

Data\DataObject includes magic getters and setters to provide access to the internal property store as if they were explicitly declared properties of the class.

The bind method allows for injecting an existing array or object into the Data\DataObject object.

The dump method gets a plain stdClass version of the Data\DataObject object's properties. It will also support recursion to a specified number of levels where the default is 3 and a depth of 0 would return a stdClass object with all the properties in native form. Note that the dump method will only return virtual properties set binding and magic methods. It will not include any concrete properties defined in the class itself.

The JsonSerializable interface is implemented. This method proxies to the dump method (defaulting to a recursion depth of 3). Note that this interface only takes effect implicitly in PHP 5.4 so any code built for PHP 5.3 needs to explicitly use either the jsonSerialize or the dump method before passing to json_encode.

The Data\DataObject class also implements the IteratorAggregate interface so it can easily be used in a foreach statement.

Data\DataSet

Data\DataSet is a collection class that allows the developer to operate on a list of Data\DataObject objects as if they were in a typical PHP array (Data\DataSet implements the ArrayAccess, Countable and Iterator interfaces).

Construction

A typical Data\DataSet object will be instantiated by passing an array of Data\DataObject objects in the constructor.

General Usage

Array elements can be manipulated with the offsetSet and offsetUnset methods, or by using PHP array nomenclature.

The magic __get method in the Data\DataSet class effectively works like a "get column" method. It will return an array of values of the properties for all the objects in the list.

The magic __set method is similar and works like a "set column" method. It will set all a value for a property for all the objects in the list.

The clear method will clear all the objects in the data set.

The keys method will return all of the keys of the objects stored in the set. It works like the array_keys function does on an PHP array.

Data\DataSet supports magic methods that operate on all the objects in the list. Calling an arbitrary method will iterate of the list of objects, checking if each object has a callable method of the name of the method that was invoked. In such a case, the return values are assembled in an array forming the return value of the method invoked on the Data\DataSet object. The keys of the original objects are maintained in the result array.

Data\DumpableInterface

Data\DumpableInterface is an interface that defines a dump method for dumping the properties of an object as a stdClass with or without recursion.

Installation via Composer

Add "joomla/data": "~3.0" to the require block in your composer.json and then run composer install.

Alternatively, you can simply run the following from the command line:

If you want to include the test sources, use


All versions of data with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.0
joomla/registry Version ^3.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 joomla/data contains the following files

Loading the files please wait ....