protected static function setAccessSettings(array $accessParams) { if (static::isRegistered()) { $id = static::getEngine()->getId(); $result = SearchEngineTable::update($id, array("CLIENT_ID" => $accessParams["client_id"], "CLIENT_SECRET" => $accessParams["client_secret"], "SETTINGS" => "")); } else { $result = SearchEngineTable::add(array("CODE" => Bitrix::ENGINE_ID, "NAME" => "Bitrix", "ACTIVE" => SearchEngineTable::ACTIVE, "CLIENT_ID" => $accessParams["client_id"], "CLIENT_SECRET" => $accessParams["client_secret"], "REDIRECT_URI" => static::getRedirectUri())); } if ($result->isSuccess()) { static::$engine = null; } }
protected static function getEngine($engineId) { $dbEngine = SearchEngineTable::getByCode($engineId); return $dbEngine->fetch(); }
protected function saveSettings() { SearchEngineTable::update($this->engine['ID'], array( 'SETTINGS' => serialize($this->engineSettings) )); }
public static function getByCode($code) { return SearchEngineTable::getList(array('filter' => array('CODE' => $code))); }