/** * Get Module version from DB * * @param string $moduleName * @return string */ function getDbVersion($resName) { if (!$this->_read) { return false; } if (is_null(self::$_versions)) { // if Core module not instaled try { $select = $this->_read->select()->from($this->_resTable, array('code', 'version')); self::$_versions = $this->_read->fetchPairs($select); } catch (Exception $e) { self::$_versions = array(); } } return isset(self::$_versions[$resName]) ? self::$_versions[$resName] : false; }
/** * Get resource data version * * @param string $resName * @return string | false */ public function getDataVersion($resName) { if (!$this->_read) { return false; } if (is_null(self::$_dataVersions)) { $select = $this->_read->select()->from($this->_resTable, array('code', 'data_version')); self::$_dataVersions = $this->_read->fetchPairs($select); } return isset(self::$_dataVersions[$resName]) ? self::$_dataVersions[$resName] : false; }