/** * determine which Magento versions seem to be compatible to this call * * @return array Array of Magento versions (e.g. [ 'CE 1.6.2.0', 'CE 1.7.0.2' ]) */ public function getMagentoVersions() { if ($fixedVersions = $this->_getFixedVersions()) { return $fixedVersions; } $query = 'SELECT ' . implode(', ', $this->_getFieldsToSelect()) . ' FROM [' . $this->_table . '] t INNER JOIN [' . $this->_tagType . '_signature] ts ON (t.id = ts.' . $this->_tagType . '_id) INNER JOIN [signatures] s ON (ts.signature_id = s.id) WHERE t.name = %s GROUP BY s.id'; try { /* find all signatures matching that call */ $result = dibi::query($query, $this->getName()); } catch (\DibiDriverException $e) { dibi::test($query, $this->getName()); throw $e; } $versions = array(); if (is_null($result) || 0 == count($result)) { return null; } /* get best matching signature id */ if (1 < count($result)) { $signatureIds = $this->_getBestMatching($result->fetchAll()); } else { try { $signatureIds = array_keys($result->fetchPairs()); } catch (\DibiDriverException $e) { dibi::test($query, $signatureId); throw $e; } } if (false == is_array($signatureIds) || 0 == count($signatureIds)) { Logger::warning('Could not find any matching definition of ' . $this->_name); return null; } /* fetch Magento versions */ $query = 'SELECT CONCAT(edition, " ", version) AS magento FROM [magento_signature] ms INNER JOIN [magento] m ON (ms.magento_id = m.id) WHERE ms.signature_id IN (%s) GROUP BY magento'; try { return dibi::fetchPairs($query, $signatureIds); } catch (\DibiDriverException $e) { dibi::test($query, $signatureId); throw $e; } }
public function __call($method, $args) { Logger::warning("Called Magento method \"{$method}\" in installer script"); return $this; }