Skip to content

Instantly share code, notes, and snippets.

View fritz-gerneth's full-sized avatar

Fritz Gerneth fritz-gerneth

  • funct GmbH
  • Munich
View GitHub Profile
<?php
namespace SpiffyDoctrine\Doctrine\Common;
use Doctrine\Common\EventManager as DoctrineEventManager,
SpiffyDoctrine\Doctrine\Instance;
class EventManager extends Instance implements \Zend\Loader\LocatorAware
{
/**
* @var array
*/
class InjectLocatorListener implements \Doctrine\Common\EventSubscriber, \Zend\Loader\LocatorAware
{
protected $locator;
public function postLoad(\Doctrine\ORM\Event\LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getEntity();
if($entity instanceof \Zend\Loader\LocatorAware)
{
$entity->setLocator($this->getLocator());
import android.os.Bundle;
import android.os.RemoteException;
/**
* The common interface for all connections. This interface only states that
* this object is a connection at all.
*
* @author Fritz Gerneth
*
*/
<?php
return array(
'di' => array(
'instance' => array(
'Test\Event\Collection' => array(
'injections' => array(
'Test\Event\View',
'Test\Event\View',
),
<?php
return array(
'di' => array(
'instance' => array(
'Zend\EventManager\EventManager' => array(
'injections' => array(
'attach' => array(
array('event' => 'Test\Event\Collection'),
)
class Module
{
public function init(Manager $moduleManager)
{
$events = $moduleManager->events();
$sharedEvents = $events->getSharedCollections();
$sharedEvents->attach('Zend\Mvc\Bootstrap', 'bootstrap', array($this, 'test'), 900);
}
public function test($e)
<?php
class MyController extends Zend_Controller_Action
{
private $_modelA;
private $_modelB;
public function doSomethingAction()
{
$this->_modelA->create();
}
<?php
namespace Test;
use \Zend\EventManager\EventCollection,
\Zend\EventManager\EventManagerAware,
\Zend\Di\Locator,
\Zend\EventManager\SharedEventCollectionAware,
\Zend\EventManager\SharedEventCollection;
return array(
'di' => array(
'instance' => array(
'alias' => array(
'feedaggregator' => 'Fge\Aggregator'
),
'Fge\Aggregator' => array(
'parameters' => array(
'feeds' => array(
'sdd',
class F
{
public $a = false;
public $b = false;
public function __construct($a)
{
$this->a = true;
}