php-extended / php-api-endpoint-csv-object
This package is abandoned and no longer maintained.
The author suggests using the php-extended/php-data-provider-csv package instead.
A library that implements the php-extended/php-api-endpoint-csv-interface library
6.1.0
2023-08-13 13:04 UTC
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2023-08-14 14:58:08 UTC
README
A library that implements the php-extended/php-api-endpoint-csv-interface library.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.phar
from their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-api-endpoint-csv-object ^6
Basic Usage
This library is made to be extended. The base Endpoint implementation is a generic object that is made to ease the transform into a really useful endpoint that may be something like :
use PhpExtended\Endpoint\LocalCsvEndpoint;
class MyEndpoint extends LocalCsvEndpoint
{
/**
* @return \Iterator<Foo>
*/
public function getFoos() : \Iterator
{
return $this->getObject(Foo::class, __DIR__.'/foos.csv');
}
}
Where __DIR__./'foos.csv'
is a file that contains a foo per row of csv
data, where the fields are in order with the constructor.
License
MIT (See license file).