2017 © Pedro Peláez
 

library doctrine-methods-hydrator

Hydrates presenter methods from parameters to entities

image

zenify/doctrine-methods-hydrator

Hydrates presenter methods from parameters to entities

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 21 Versions
  • 0 % Grown

The README.md

Doctrine Methods Hydrator

Build Status Quality Score Code Coverage Downloads Latest stable, (*1)

Install

$ composer require zenify/doctrine-methods-hydrator

Register the extension in config.neon:, (*2)

extensions:
    - Zenify\DoctrineMethodsHydrator\DI\MethodsHydratorExtension

    # Kdyby\Doctrine or another Doctrine to Nette implementation

The goal of this extension is to enhance native tryCall method of Control to hydrate parameters of called methods. All render*, action* and handle* methods are hydrated, if entity class typehint is present if args definition., (*3)

Usage

Use in presenter looks like this:, (*4)

class Presenter extends Nette\Application\UI\Presenter
{

    /**
     * @inject
     * @var Zenify\DoctrineMethodsHydrator\Contract\MethodsHydratorInterface
     */
    public $methodsHydrator;


    /**
     * @param string $method
     * @param array $parameters
     * @return bool
     */
    protected function tryCall($method, array $parameters)
    {
        return $this->methodsHydrator->hydrate($method, $parameters, $this);
    }

}

For Control, you can use constructor or @inject with help of DecoratorExtension., (*5)

Use Case

In template, (*6)

<a n:href="Product:detail, product => $product->getId()">Product detail</a>

In presenter, (*7)

class SomePresenter extends Presenter
{

    public function actionDetail(App\Entities\Product $product)
    {
        dump($product); // "App\Entities\Product" object
    }

}

The Versions

03/11 2015

dev-master

9999999-dev

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

The Development Requires

03/11 2015

v5.1.1

5.1.1.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

The Development Requires

11/06 2015

v5.1.0

5.1.0.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

The Development Requires

31/08 2014

v2.0.0

2.0.0.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

10/08 2014

v1.0.6

1.0.6.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

10/08 2014

v1.0.5

1.0.5.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

27/07 2014

v1.0.4

1.0.4.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

24/07 2014

v1.0.3

1.0.3.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

24/07 2014

v1.0.2

1.0.2.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

23/07 2014

v1.0.1

1.0.1.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires

 

19/06 2014

v1.0.0

1.0.0.0

Hydrates presenter methods from parameters to entities

  Sources   Download

MIT

The Requires