Neos\Flow\Persistence\Generic\Query::injectObjectManager PHP Method

injectObjectManager() public method

Injects the Flow object factory
public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $qomFactory ) : void
$qomFactory Neos\Flow\ObjectManagement\ObjectManagerInterface
return void
    public function injectObjectManager(ObjectManagerInterface $qomFactory)
    {
        $this->objectManager = $qomFactory;
    }

Usage Example

 /**
  * Sets up this test case
  *
  */
 public function setUp()
 {
     $this->reflectionService = $this->createMock(ReflectionService::class);
     $this->objectManager = $this->createMock(ObjectManagerInterface::class);
     $this->query = new Persistence\Generic\Query('someType', $this->reflectionService);
     $this->query->injectObjectManager($this->objectManager);
 }