2017 © Pedro Peláez
 

library resource-handler

image

managlea/resource-handler

  • Friday, October 28, 2016
  • by managlea-adm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ResourceHandler

Package to provide wrapper for handling resources (resource as in RESTful APIs etc), (*1)

Scrutinizer Code Quality Build Status Code Coverage
Code Climate Test Coverage
SensioLabsInsight
Codacy Badge
Build Status Circle CI
PHP-Eye, (*2)

Basic usage

Read more about packages which are required by ResourceHandler * Managlea/ResourceMapper - for mapping resources to objects * Managlea/EntityManager - for getting objects from DB, (*3)

// Create new EntityManagerFactory (instanceof Managlea\Component\EntityManagerFactoryInterface)
$entityManagerFactory = new EntityManagerFactory();

// Create new ResourceMapper by passing $entityManagerFactory in as parameter
$resourceMapper = ResourceMapper::initialize($entityManagerFactory);


// Create new resourceHandler (by passing correct resourceMapper in as parameter)
$resourceHandler = ResourceHandler::initialize($resourceMapper);

// Get single foo object with id 1
$foo = $resourceHandler->getSingle('foo', 1);

// Get collection of foos (by default 20 items, without any filters)
$fooCollection = $resourceHandler->getCollection('foo');

The Versions

28/10 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kauri Kont-Kontson