Skip to content

Instantly share code, notes, and snippets.

@whisher
Created June 24, 2013 21:25
Show Gist options
  • Save whisher/5853740 to your computer and use it in GitHub Desktop.
Save whisher/5853740 to your computer and use it in GitHub Desktop.
//I've made like
namespace FbswitBlog\Controller\Plugin;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use FbswitBlog\Service\Category as CategoryService;
use FbswitBlog\Service\ContentNodes as ContentNodesService;
use FbswitBlog\Service\Page as PageService;
class FbswitBlogService extends AbstractPlugin
{
protected $categoryService;
protected $contentNodesService;
protected $pageService;
public function getCategoryService()
{
return $this->categoryService;
}
public function setCategoryService(CategoryService $service)
{
$this->categoryService = $service;
return $this;
}
public function getContentNodesService()
{
return $this->contentNodesService;
}
public function setContentNodesService(ContentNodesService $service)
{
$this->contentNodesService = $service;
return $this;
}
public function getPagesService()
{
return $this->pageService;
}
public function setPagesService(PageService $service)
{
$this->pageService = $service;
return $this;
}
}
//but I ended up with a more raisonable :)
namespace FbswitBlog\Controller\Plugin;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use FbswitBlog\Service\Page as PageService;
class FbswitPageService extends AbstractPlugin
{
protected $pageService;
public function get()
{
return $this->pageService;
}
public function set(PageService $service)
{
$this->pageService = $service;
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment