PHP Class Backend\Modules\Search\Engine\Model

Mostra file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
deleteSynonym ( integer $id ) Delete a synonym
existsSynonymById ( integer $id ) : boolean Check if a synonym exists
existsSynonymByTerm ( string $term, integer $exclude = null ) : boolean Check if a synonym exists
getModuleSettings ( ) : array Get modules search settings
getSynonym ( integer $id ) : array Get a synonym
insertModuleSettings ( string $module, string $searchable, string $weight ) Insert module search settings
insertSynonym ( array $item ) : integer Insert a synonym
invalidateCache ( ) Invalidate search cache
removeIndex ( string $module, integer $otherId, string $language = null ) Remove an index
saveIndex ( string $module, integer $otherId, array $fields, string $language = null ) Edit an index
updateSynonym ( array $item ) Update a synonym

Method Details

deleteSynonym() public static method

Delete a synonym
public static deleteSynonym ( integer $id )
$id integer The id of the item we want to delete.

existsSynonymById() public static method

Check if a synonym exists
public static existsSynonymById ( integer $id ) : boolean
$id integer The id of the item we're looking for.
return boolean

existsSynonymByTerm() public static method

Check if a synonym exists
public static existsSynonymByTerm ( string $term, integer $exclude = null ) : boolean
$term string The term we're looking for.
$exclude integer Exclude a certain id.
return boolean

getModuleSettings() public static method

Get modules search settings
public static getModuleSettings ( ) : array
return array

getSynonym() public static method

Get a synonym
public static getSynonym ( integer $id ) : array
$id integer The id of the item we're looking for.
return array

insertModuleSettings() public static method

Insert module search settings
public static insertModuleSettings ( string $module, string $searchable, string $weight )
$module string The module wherein will be searched.
$searchable string Is the module searchable?
$weight string Weight of this module's results.

insertSynonym() public static method

Insert a synonym
public static insertSynonym ( array $item ) : integer
$item array The data to insert in the db.
return integer

invalidateCache() public static method

Invalidate search cache
public static invalidateCache ( )

removeIndex() public static method

Remove an index
public static removeIndex ( string $module, integer $otherId, string $language = null )
$module string The module wherein will be searched.
$otherId integer The id of the record.
$language string The language to use.

saveIndex() public static method

Edit an index
public static saveIndex ( string $module, integer $otherId, array $fields, string $language = null )
$module string The module wherein will be searched.
$otherId integer The id of the record.
$fields array A key/value pair of fields to index.
$language string The frontend language for this entry.

updateSynonym() public static method

Update a synonym
public static updateSynonym ( array $item )
$item array The data to update in the db.