static function compareHash($item) { $hash = md5(serialize($item)); $params = array( 'select' => array('ID', 'HASH'), 'filter' => array( '=IIKO_ID' => $item['XML_ID'] ) ); $arHash = HashTable::getRow($params); if ($arHash['HASH'] === $hash) { return true; } if ($arHash['ID'] > 0) { HashTable::update($arHash['ID'], array('HASH' => $hash)); return false; } HashTable::add(array( 'IIKO_ID' => $item['XML_ID'], 'HASH' => $hash )); return false; }
function installDB() { if (Loader::includeModule($this->MODULE_ID)) { \Iiko\DB\ModifiersTable::getEntity()->createDbTable(); \Iiko\DB\ElementModifiersTable::getEntity()->createDbTable(); \Iiko\DB\HashTable::getEntity()->createDbTable(); } }