. */ /** * Doctrine_Connection_Module * * @package Doctrine * @subpackage Connection * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen */ class Doctrine_Connection_Module { /** * @var Doctrine_Connection $conn Doctrine_Connection object, every connection * module holds an instance of Doctrine_Connection */ protected $conn; /** * @var string $moduleName the name of this module */ protected $moduleName; /** * @param Doctrine_Connection $conn Doctrine_Connection object, every connection * module holds an instance of Doctrine_Connection */ public function __construct($conn = null) { if ( ! ($conn instanceof Doctrine_Connection)) { $conn = Doctrine_Manager::getInstance()->getCurrentConnection(); } $this->conn = $conn; $e = explode('_', get_class($this)); $this->moduleName = $e[1]; } /** * getConnection * returns the connection object this module uses * * @return Doctrine_Connection */ public function getConnection() { return $this->conn; } /** * getModuleName * returns the name of this module * * @return string the name of this module */ public function getModuleName() { return $this->moduleName; } }