This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added functionality for hashing keywords, stored in SearchIndexes table.
- Loading branch information
1 parent
f15c97a
commit 0060c24
Showing
3 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* @version $Id$ | ||
* @package Appleseed.Components | ||
* @subpackage Search | ||
* @copyright Copyright (C) 2004 - 2010 Michael Chisari. All rights reserved. | ||
* @link http://opensource.appleseedproject.org | ||
* @license GNU General Public License version 2.0 (See LICENSE.txt) | ||
*/ | ||
|
||
// Restrict direct access | ||
defined( 'APPLESEED' ) or die( 'Direct Access Denied' ); | ||
|
||
/** Profile Component Summary Model | ||
* | ||
* Profile Component Summary Model Class | ||
* | ||
* @package Appleseed.Components | ||
* @subpackage Profile | ||
*/ | ||
class cSearchModel extends cModel { | ||
|
||
protected $_Tablename = "SearchIndexes"; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @access public | ||
*/ | ||
public function __construct ( $pTables = null ) { | ||
parent::__construct( $pTables ); | ||
} | ||
|
||
public function Index ( $pContext, $pContext_FK, $pKeywords ) { | ||
|
||
$this->Retrieve ( array ( 'Context' => $pContext, 'Context_FK' => $pContext_FK ) ); | ||
|
||
if ( $this->Get ( 'Total' ) > 0 ) { | ||
$this->Fetch(); | ||
} else { | ||
$this->Set ( 'Created', NOW() ); | ||
} | ||
|
||
$this->Set ( 'Context', $pContext ); | ||
$this->Set ( 'Context_FK', $pContext_FK ); | ||
$this->Set ( 'Keywords', $pKeywords ); | ||
$this->Set ( 'Updated', NOW() ); | ||
|
||
$this->Save(); | ||
|
||
return ( true ); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters