PHP code example of zenify / doctrine-methods-hydrator
1. Go to this page and download the library: Download zenify/doctrine-methods-hydrator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zenify / doctrine-methods-hydrator example snippets
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);
}
}
class SomePresenter extends Presenter
{
public function actionDetail(App\Entities\Product $product)
{
dump($product); // "App\Entities\Product" object
}
}