2017 © Pedro Peláez
 

library actions

Action component

image

codifico/actions

Action component

  • Wednesday, October 28, 2015
  • by drymek
  • Repository
  • 1 Watchers
  • 0 Stars
  • 111 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 16 % Grown

The README.md

Actions

Common action based coupled to components: * The HttpFoundation Component * The Form Component, (*1)

Allows you to quickly create CRUD actions., (*2)

Scrutinizer Code Quality SensioLabsInsight, (*3)

Latest Stable Version Latest Unstable Version Total Downloads License, (*4)

Instalation

php composer.phar require codifico/actions:dev-master

Usage

Prepare your repository to be able to work with actions:, (*5)


class MyRepository implements ActionRepository { //(...) } ### Basic If you want to use the basic version (based on Form and HttpFoundation Components), create your own classes: ```php use Codifico\Component\Actions\Action\Basic\CreateAction; use Codifico\Component\Actions\Action\Basic\IndexAction; use Codifico\Component\Actions\Action\Basic\RemoveAction; use Codifico\Component\Actions\Action\Basic\UpdateAction; class MyEntityCreateAction extends CreateAction { //(...) } class MyEntityIndexAction extends IndexAction { //(...) } class MyEntityRemoveAction extends RemoveAction { //(...) } class MyEntityUpdateAction extends UpdateAction { //(...) }

and at last, but not at least use then:, (*6)

//Create:
$create = new MyEntityCreateAction($repository, $formFactory, $myEntityType);
$create->execute();

//Index:
$index = new MyEntityIndexAction($repository);
$index->setCriteria($criteria)->execute();

//Remove:
$remove = new MyEntityRemoveAction($repository);
$remove->setObject($object)->execute();

//Update:
$update = new MyEntityUpdateAction($formFactory, $myEntityType);
$update->setObject($object)->execute();

Custom

Otherwise, you might want to use interfaces:, (*7)

  • Codifico\Component\Actions\Action\CreateAction
  • Codifico\Component\Actions\Action\RemoveAction
  • Codifico\Component\Actions\Action\UpdateAction

or even:, (*8)

  • Codifico\Component\Actions\Action\Action

Copyright (c) 2015 Marcin Dryka (drymek). See LICENSE for details., (*9)

Contributors

The Versions

28/10 2015

dev-master

9999999-dev http://codifico.pl/

Action component

  Sources   Download

MIT

The Requires

 

The Development Requires

actions codifico