baserCMS クラスリファレンス

BlogCategoriesService
in package
implements BlogCategoriesServiceInterface uses BcContainerTrait

BlogCategoriesService

Table of Contents

Interfaces

BlogCategoriesServiceInterface
BlogCategoriesServiceInterface

Properties

$BlogCategories  : BlogCategoriesTable|Table

Methods

__construct()  : mixed
Construct
batch()  : bool
一括処理
create()  : EntityInterface|null
新規作成
delete()  : bool
削除する
get()  : EntityInterface
単一レコードを取得する
getControlSource()  : mixed
コントロールソース取得
getIndex()  : Query
一覧を取得する
getList()  : array<string|int, mixed>
ブログカテゴリーリスト取得
getNamesById()  : array<string|int, mixed>
IDを指定して名前リストを取得する
getNew()  : EntityInterface
新規エンティティ取得
getService()  : array<string|int, mixed>|mixed|object
Get Service
getTreeIndex()  : array<string|int, mixed>
getTreeIndex
hasService()  : bool
Has Service
move()  : EntityInterface|bool
カテゴリの配置を移動する(並び替え・再親付け)
resetTree()  : bool
ブログカテゴリのツリー構造をリセットする
update()  : EntityInterface|null
更新する
verityTree()  : bool
ブログカテゴリのツリー構造をチェックする
createIndexConditions()  : Query
createIndexConditions

Properties

Methods

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

create()

新規作成

public create(int $blogContentId, array<string|int, mixed> $postData) : EntityInterface|null
Parameters
$blogContentId : int
$postData : array<string|int, mixed>
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[, array<string|int, mixed> $queryParams = [] ]) : EntityInterface
Parameters
$id : int
$queryParams : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
EntityInterface

getControlSource()

コントロールソース取得

public getControlSource(string $field, array<string|int, mixed> $options) : mixed
Parameters
$field : string
$options : array<string|int, mixed>
Tags
checked
noTodo
unitTest

getIndex()

一覧を取得する

public getIndex(int $blogContentId, array<string|int, mixed> $queryParams[, string $type = 'all' ]) : Query
Parameters
$blogContentId : int
$queryParams : array<string|int, mixed>
$type : string = 'all'
Tags
checked
noTodo
unitTest
Return values
Query

getList()

ブログカテゴリーリスト取得

public getList(mixed $blogContentId[, array<string|int, mixed> $queryParams = [] ]) : array<string|int, mixed>
Parameters
$blogContentId : mixed
$queryParams : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getNamesById()

IDを指定して名前リストを取得する

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

getNew()

新規エンティティ取得

public getNew(int $blogContentId[, int|null $parentId = null ]) : EntityInterface
Parameters
$blogContentId : int
$parentId : int|null = null

親カテゴリID(子カテゴリとして追加する場合に指定)

Tags
checked
noTodo
unitTest
Return values
EntityInterface

getService()

Get Service

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

getTreeIndex()

getTreeIndex

public getTreeIndex(int $blogContentId, array<string|int, mixed> $queryParams) : array<string|int, mixed>
Parameters
$blogContentId : int
$queryParams : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

hasService()

Has Service

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

move()

カテゴリの配置を移動する(並び替え・再親付け)

public move(array<string|int, mixed> $origin, array<string|int, mixed> $target) : EntityInterface|bool

ツリー上のドラッグ&ドロップに対応する。基本的に target.id の上に移動する前提で、 target.id が空の場合は同じ親の中の一番下に配置する。親が変わる場合は先に parent_id を 付け替え(TreeBehavior が末尾へ再配置)、その後オフセットで目標位置まで移動する。 移動元の親IDは DB 上のエンティティから取得するため、origin.parentId は利用しない。

Parameters
$origin : array<string|int, mixed>

移動元 ['id' => int](parentId は後方互換のため受け付けるが利用しない)

$target : array<string|int, mixed>

移動先 ['id' => int|null, 'parentId' => int|null]

Tags
checked
noTodo
unitTest
Return values
EntityInterface|bool

resetTree()

ブログカテゴリのツリー構造をリセットする

public resetTree() : bool

全てのカテゴリをルート直下にフラット化し、lft / rght を振り直す。

Tags
checked
noTodo
unitTest
Return values
bool

update()

更新する

public update(EntityInterface $target, array<string|int, mixed> $postData) : EntityInterface|null
Parameters
$target : EntityInterface
$postData : array<string|int, mixed>
Tags
throws
PersistenceFailedException
checked
noTodo
unitTest
Return values
EntityInterface|null

verityTree()

ブログカテゴリのツリー構造をチェックする

public verityTree() : bool

問題がある場合にはログを出力する

Tags
checked
noTodo
unitTest
Return values
bool

createIndexConditions()

createIndexConditions

private createIndexConditions(Query $query, int $blogContentId[, array<string|int, mixed> $params = [] ]) : Query
Parameters
$query : Query
$blogContentId : int
$params : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
Query
On this page

Search results