Skip to content

Commit

Permalink
added getServiceLocator in both view-helper, we get a `Zend\ServiceMa…
Browse files Browse the repository at this point in the history
…nager\AbstractPluginManager` object so we have to use this method
  • Loading branch information
kokspflanze committed Apr 5, 2016
1 parent ba02f46 commit 41a2610
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<?php
namespace ZfcDatagrid\Renderer\BootstrapTable\View\Helper;

use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

class TableRowFactory implements FactoryInterface
{
/**
* @param ServiceLocatorInterface $serviceLocator
* @param ServiceLocatorInterface|AbstractPluginManager $serviceLocator
* @return TableRow
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$tableRow = new TableRow();
if ($serviceLocator->has('translator')) {
if ($serviceLocator->getServiceLocator()->has('translator')) {
/** @noinspection PhpParamsInspection */
$tableRow->setTranslator($serviceLocator->get('translator'));
$tableRow->setTranslator($serviceLocator->getServiceLocator()->get('translator'));
}

return $tableRow;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<?php
namespace ZfcDatagrid\Renderer\JqGrid\View\Helper;

use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

class ColumnsFactory implements FactoryInterface
{
/**
* @param ServiceLocatorInterface $serviceLocator
* @param ServiceLocatorInterface|AbstractPluginManager $serviceLocator
* @return Columns
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$tableRow = new Columns();
if ($serviceLocator->has('translator')) {
if ($serviceLocator->getServiceLocator()->has('translator')) {
/** @noinspection PhpParamsInspection */
$tableRow->setTranslator($serviceLocator->get('translator'));
$tableRow->setTranslator($serviceLocator->getServiceLocator()->get('translator'));
}

return $tableRow;
Expand Down

0 comments on commit 41a2610

Please sign in to comment.