baserCMS クラスリファレンス

SearchIndexesFrontService extends SearchIndexesService
in package
implements SearchIndexesFrontServiceInterface

SearchIndexesFrontService

Table of Contents

Interfaces

SearchIndexesFrontServiceInterface
Interface SearchIndexesFrontServiceInterface

Properties

$SearchIndexes  : SearchIndexesTable
SearchIndexes Table
$SearchIndexes  : SearchIndexesTable

Methods

__construct()  : mixed
SearchIndexesService constructor.
allowPublish()  : bool|int
公開状態確認
batch()  : bool
一括処理
changePriority()  : EntityInterface|null
優先度を変更する
delete()  : bool
検索インデックスを削除する
get()  : EntityInterface
索引を取得する
getIndex()  : Query
一覧データを取得
getService()  : array<string|int, mixed>|mixed|object
Get Service
getViewVarsForSearch()  : array<string|int, mixed>
サイト内検索用の view 変数を取得する
hasService()  : bool
Has Service
reconstruct()  : bool
検索インデックス再構築
createIndexConditions()  : array<string|int, mixed>
管理画面ページ一覧の検索条件を取得する
parseQuery()  : array<string|int, mixed>
検索キーワードを分解し配列に変換する

Properties

Methods

__construct()

SearchIndexesService constructor.

public __construct() : mixed
Tags
checked
unitTest
noTodo

allowPublish()

公開状態確認

public allowPublish(array<string|int, mixed> $data) : bool|int
Parameters
$data : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
bool|int

batch()

一括処理

public batch(string $method, array<string|int, mixed> $ids) : bool
Parameters
$method : string
$ids : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
bool

changePriority()

優先度を変更する

public changePriority(EntityInterface $target,  $priority) : EntityInterface|null
Parameters
$target : EntityInterface
$priority :
Tags
checked
noTodo
unitTest
Return values
EntityInterface|null

delete()

検索インデックスを削除する

public delete(int $id) : bool
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
bool

get()

索引を取得する

public get(int $id) : EntityInterface
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
EntityInterface

getIndex()

一覧データを取得

public getIndex([array<string|int, mixed> $queryParams = [] ]) : Query

並び順

  • priority: 降順
  • modified: 降順
  • id: 昇順
Parameters
$queryParams : array<string|int, mixed> = []
  • limit: 取得件数
  • その他、createIndexConditions を参照
Tags
checked
noTodo
unitTest
Return values
Query

getService()

Get Service

public getService( $service) : array<string|int, mixed>|mixed|object
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>|mixed|object

getViewVarsForSearch()

サイト内検索用の view 変数を取得する

public getViewVarsForSearch(ResultSet|ResultSetInterface $searchIndexes, ServerRequest $request) : array<string|int, mixed>

view 変数

  • searchIndexes: 検索インデックス一覧
  • query: 検索キーワード
  • contentFolders: コンテンツフォルダー一覧
  • searchIndexesFront: サイト内検索フォーム用のコンテキスト
Parameters
$searchIndexes : ResultSet|ResultSetInterface
$request : ServerRequest
Tags
checked
unitTest
unitTest
noTodo
Return values
array<string|int, mixed>

hasService()

Has Service

public hasService( $service) : bool
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
bool

reconstruct()

検索インデックス再構築

public reconstruct([int $parentContentId = null ]) : bool
Parameters
$parentContentId : int = null

親となるコンテンツID

Tags
checked
noTodo
unitTest
Return values
bool

createIndexConditions()

管理画面ページ一覧の検索条件を取得する

protected createIndexConditions(array<string|int, mixed> $options) : array<string|int, mixed>

パラメーターのカッコ内は省略形。省略形を優先する。 keyword は、LIKE検索とし、titledetail を対象とする。

Parameters
$options : array<string|int, mixed>
  • keyword(q): 検索キーワード
  • site_id(s): サイトID
  • content_id(c): コンテンツID
  • content_filter_id(cf): コンテンツフィルダーID
  • type: コンテンツタイプ
  • model(m): モデル名(エンティティ名)
  • priority: 優先度
  • status: 公開状態。publish もしくは 1 の場合、公開期間も加味する。
  • folder_id(f): フォルダーID
Tags
checked
unitTest
unitTest
noTodo
Return values
array<string|int, mixed>

parseQuery()

検索キーワードを分解し配列に変換する

protected parseQuery(string $query) : array<string|int, mixed>

半角スペース、全角スペースで分解する。 エスケープ処理を行う。

Parameters
$query : string
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

        
On this page

Search results