Пример #1
0
 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;
     }
 }
Пример #2
0
 protected static function getEngine($engineId)
 {
     $dbEngine = SearchEngineTable::getByCode($engineId);
     return $dbEngine->fetch();
 }
Пример #3
0
	protected function saveSettings()
	{
		SearchEngineTable::update($this->engine['ID'], array(
			'SETTINGS' => serialize($this->engineSettings)
		));
	}
Пример #4
0
 public static function getByCode($code)
 {
     return SearchEngineTable::getList(array('filter' => array('CODE' => $code)));
 }