Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a factory for the Trean_TagBrowser.
- Loading branch information
Showing
4 changed files
with
67 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* The factory for the calendars handler. | ||
* | ||
* See the enclosed file COPYING for license information (GPL). If you | ||
* did not receive this file, see http://www.horde.org/licenses/gpl. | ||
* | ||
* @author Gunnar Wrobel <wrobel@pardus.de> | ||
* @package Kronolith | ||
*/ | ||
class Trean_Factory_TagBrowser | ||
{ | ||
/* | ||
* The injector. | ||
* | ||
* @var Horde_Injector | ||
*/ | ||
protected $_injector; | ||
|
||
/** | ||
* The tag browser | ||
* | ||
* @var Trean_TagBrowser | ||
*/ | ||
protected $_browser; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param Horde_Injector $injector The injector to use. | ||
*/ | ||
public function __construct(Horde_Injector $injector) | ||
{ | ||
$this->_injector = $injector; | ||
} | ||
|
||
/** | ||
* Return a Trean_TagBrowser | ||
* | ||
* @return Trean_TagBrowser | ||
*/ | ||
public function create() | ||
{ | ||
if (empty($_browser)) { | ||
$this->_browser = new Trean_TagBrowser($this->_injector->getInstance('Trean_Tagger')); | ||
} | ||
|
||
return $this->_browser; | ||
} | ||
} |
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
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