/** * Get the Magento version for the given client. * * @param MagentoSoapClient $client * * @return float */ protected function getMagentoVersion(MagentoSoapClient $client = null) { if (null === $client) { return null; } if (!$this->version) { try { $magentoVersion = $client->call('core_magento.info')['magento_version']; } catch (\SoapFault $e) { return self::MAGENTO_VERSION_1_6; } catch (SoapCallException $e) { throw $e; } $pattern = '/^(?P<version>[0-9]+\\.[0-9]+)(\\.[0-9])*/'; if (preg_match($pattern, $magentoVersion, $matches)) { $this->version = $matches['version']; } else { $this->version = $magentoVersion; } } return $this->version; }
/** * Get the products status for the given skus. * * @param array $skus * * @return array */ protected function getStatusForSkus($skus) { if ($skus) { $filters = json_decode(json_encode(['complex_filter' => [['key' => 'sku', 'value' => ['key' => 'in', 'value' => $skus]]]]), false); } else { $filters = []; } return $this->client->call(self::SOAP_ACTION_CATALOG_PRODUCT_LIST, $filters); }