This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The task is to rewrite the Hydrator component using the RecursiveIteratorIterator stuff. This will allow us A LOT | |
* of nice stuff, while being able to still have speed thanks to the C implementation. The most important things of | |
* using RecursiveIteratorIterator is to allow the usage of setMaxDepth, as well as plug FilterIterator (current hydrator | |
* filters are slow) | |
* | |
* The idea is to allow the hydrators recursively hydrate other things. For instance, if we have: | |
*/ | |
class ObjectA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Another idea I had was to create a pre_routing middleware, that would change the URL, so that next step Expressive would | |
"dispatch" to the next middleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyMiddleware | |
{ | |
private $mapping; | |
public function __invoke($request, $response, $out) | |
{ | |
$var = $request->getAttribute('job'); | |
$middleware = $this->mapping[$var]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hpclass AdminEditForm extends Form | |
{ | |
/** | |
* {@inheritDoc} | |
*/ | |
public function init() | |
{ | |
$this->add(array( | |
'type' => 'User\Form\UserFieldset', | |
'name' => 'user', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function coucou() | |
{ | |
foreach ($this->nSide as $n) { | |
$n->setMyFlag(true); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace SlmQueue\Controller; | |
use SlmQueue\Controller\Exception\WorkerProcessException; | |
use SlmQueue\Exception\SlmQueueExceptionInterface; | |
use SlmQueue\Worker\WorkerInterface; | |
use Zend\Mvc\Controller\AbstractActionController; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license MIT | |
* @author Michaël Gallego <mic.gallego@gmail.com> | |
*/ | |
class RestAggregateHydrator extends AggregateHydrator | |
{ | |
/** | |
* Hydrators are runned in a specific order to allow pre-process at each step | |
*/ | |
const PAGINATOR_PRIORITY = 500; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'queue_manager' => array( | |
'my-object' => array( | |
'factory' => 'MyFactory', | |
'options' => array( | |
) | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @ORM\Entity | |
* @REST\Controller(item="UserItemController", collection="UsersController") | |
*/ | |
class User | |
{ | |
/** | |
* @REST\ExposeAssociation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getLatestMissions($categoryId = null, $query = null) | |
{ | |
$qb = $this->getEntityManager()->createQueryBuilder(); | |
// blabla | |
$query = $qb->getQuery() | |
->useResultCache(true, 480); | |
$paginatorAdapter = new PaginatorAdapter(new DoctrinePaginator($query, true)); |