baserCMS クラスリファレンス

ContentsServiceInterface extends CrudBaseServiceInterface

Interface ContentsServiceInterface

Table of Contents

Methods

alias()  : EntityInterface
aliasを作成する
batch()  : bool
一括処理
convertTreeList()  : array<string|int, mixed>
ツリー構造のデータを コンボボックスのデータ用に変換する
create()  : EntityInterface
新規登録する
delete()  : mixed
削除する
deleteAll()  : int
該当するコンテンツ情報をすべて論理削除する
deleteRecursive()  : void
再帰的に削除 ※ エイリアスの場合は直接削除
encodeParsedUrl()  : array<string|int, mixed>
エンコードされたURLをデコードせずにパースする ※DBのレコードがエンコードされたまま保存されてる場合があるためその値を取得する際にデコードが邪魔になる際使用する
exists()  : bool
exists
existsContentByUrl()  : bool
指定したURLのパス上のコンテンツでフォルダ以外が存在するか確認
get()  : EntityInterface
単一データを取得する
getChildren()  : Query|null
コンテンツの子要素を取得する
getConditionAllowPublish()  : array<string|int, mixed>
公開済の conditions を取得
getContentFolderList()  : array<string|int, mixed>|bool
コンテンツフォルダーのリストを取得 コンボボックス用
getContentsInfo()  : array<string|int, mixed>
コンテンツ情報を取得する
getIndex()  : Query
テーブル用のコンテンツ管理の一覧データを取得
getList()  : array<string|int, mixed>
リストデータを取得(コントロールソースに利用)
getNeighbors()  : array<string|int, mixed>
条件に基づいて指定したフィールドの隣のデータを所得する
getNew()  : EntityInterface
新しいデータの初期値を取得する
getParentLayoutTemplate()  : string
レイアウトテンプレートを取得する
getPath()  : QueryInterface
ツリー構造のパスを取得する
getTableIndex()  : Query
テーブル用のコンテンツ管理の一覧データを取得
getTitlesById()  : array<string|int, mixed>
IDを指定してタイトルリストを取得する
getTrash()  : EntityInterface|array<string|int, mixed>
ゴミ箱のコンテンツを取得する
getTrashIndex()  : Query
getTrashIndex
getTreeIndex()  : Query
getTreeIndex
getUrl()  : string
コンテンツ管理上のURLを元に正式なURLを取得する
getUrlById()  : string
コンテンツIDよりURLを取得する
hardDelete()  : bool
コンテンツ情報を削除する
hardDeleteAll()  : int
指定日時以前の該当する論理削除されたコンテンツ情報をすべて削除する
hardDeleteWithAssoc()  : bool
コンテンツ情報と紐付いてるモデルを削除する
isAllowPublish()  : bool
公開状態を取得する
isChangedStatus()  : bool
タイトル、URL、公開状態が更新されているか確認する
isMovable()  : bool
移動元のコンテンツと移動先のディレクトリから移動が可能かチェックする
isPublishById()  : bool
ID を指定して公開状態かどうか判定する
move()  : Content|bool|false
コンテンツを移動する
publish()  : EntityInterface
公開状態にする
restore()  : EntityInterface|array<string|int, mixed>|null
論理削除されたコンテンツを復元する
restoreAll()  : int
ゴミ箱内のコンテンツをすべて元に戻す
setConditions()  : Query
setConditions
setTreeConfig()  : TreeBehavior
TreeBehaviorの設定値を更新する
unpublish()  : EntityInterface
非公開状態にする
update()  : mixed
編集する

Methods

alias()

aliasを作成する

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

batch()

一括処理

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

convertTreeList()

ツリー構造のデータを コンボボックスのデータ用に変換する

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

create()

新規登録する

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

delete()

削除する

public delete(int $id) : mixed
Parameters
$id : int
Tags
checked
noTodo
unitTest

deleteAll()

該当するコンテンツ情報をすべて論理削除する

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

deleteRecursive()

再帰的に削除 ※ エイリアスの場合は直接削除

public deleteRecursive(int $id) : void
Parameters
$id : int
Tags
throws
Exception
checked
noTodo
unitTest

encodeParsedUrl()

エンコードされたURLをデコードせずにパースする ※DBのレコードがエンコードされたまま保存されてる場合があるためその値を取得する際にデコードが邪魔になる際使用する

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

$parsedUrl

exists()

exists

public exists(int $id[, bool $withTrash = false ]) : bool
Parameters
$id : int
$withTrash : bool = false

ゴミ箱の物も含めるか

Tags
checked
noTodo
unitTest
Return values
bool

existsContentByUrl()

指定したURLのパス上のコンテンツでフォルダ以外が存在するか確認

public existsContentByUrl( $url) : bool
Parameters
$url :
Tags
checked
noTodo
unitTest
Return values
bool

get()

単一データを取得する

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

getChildren()

コンテンツの子要素を取得する

public getChildren(int $id[, array<string|int, mixed> $conditions = [] ]) : Query|null
Parameters
$id : int
$conditions : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
Query|null

getConditionAllowPublish()

公開済の conditions を取得

public getConditionAllowPublish() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

公開条件(conditions 形式)

getContentFolderList()

コンテンツフォルダーのリストを取得 コンボボックス用

public getContentFolderList([int $siteId = null ][, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>|bool
Parameters
$siteId : int = null
$options : array<string|int, mixed> = []
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>|bool

getContentsInfo()

コンテンツ情報を取得する

public getContentsInfo() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getIndex()

テーブル用のコンテンツ管理の一覧データを取得

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

getList()

リストデータを取得(コントロールソースに利用)

public getList() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getNeighbors()

条件に基づいて指定したフィールドの隣のデータを所得する

public getNeighbors(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>
Tags
throws
BcException

site_idがない場合Exceptionを投げる

checked
noTodo
unitTest
Return values
array<string|int, mixed>

$neighbors

getNew()

新しいデータの初期値を取得する

public getNew() : EntityInterface
Tags
checked
noTodo
unitTest
Return values
EntityInterface

getParentLayoutTemplate()

レイアウトテンプレートを取得する

public getParentLayoutTemplate(int $id[, int|null $parentId = null ]) : string
Parameters
$id : int
$parentId : int|null = null
Tags
checked
noTodo
unitTest
Return values
string

$parentTemplate|false

getPath()

ツリー構造のパスを取得する

public getPath(string $id) : QueryInterface
Parameters
$id : string
Tags
checked
noTodo
unitTest
Return values
QueryInterface

getTableIndex()

テーブル用のコンテンツ管理の一覧データを取得

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

getTitlesById()

IDを指定してタイトルリストを取得する

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

getTrash()

ゴミ箱のコンテンツを取得する

public getTrash(int $id) : EntityInterface|array<string|int, mixed>
Parameters
$id : int
Tags
throws
RecordNotFoundException
checked
noTodo
unitTest
Return values
EntityInterface|array<string|int, mixed>

getTrashIndex()

getTrashIndex

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

getTreeIndex()

getTreeIndex

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

getUrl()

コンテンツ管理上のURLを元に正式なURLを取得する

public getUrl(string $url[, bool $full = false ][, bool $useSubDomain = false ][, bool $base = false ]) : string

ドメインからのフルパスでない場合、デフォルトでは、 サブフォルダ設置時等の baseUrl(サブフォルダまでのパス)は含まない

Parameters
$url : string

コンテンツ管理上のURL

$full : bool = false

http からのフルのURLかどうか

$useSubDomain : bool = false

サブドメインを利用しているかどうか

$base : bool = false

$full が false の場合、ベースとなるURLを含めるかどうか

Tags
checked
noTodo
unitTest
Return values
string

URL

getUrlById()

コンテンツIDよりURLを取得する

public getUrlById(int $id[, mixed $full = false ]) : string
Parameters
$id : int
$full : mixed = false
Tags
checked
noTodo
unitTest
Return values
string

URL

hardDelete()

コンテンツ情報を削除する

public hardDelete(int $id[, mixed $enableTree = false ]) : bool
Parameters
$id : int
$enableTree : mixed = false
Tags
checked
noTodo
unitTest
Return values
bool

hardDeleteAll()

指定日時以前の該当する論理削除されたコンテンツ情報をすべて削除する

public hardDeleteAll(Datetime $dateTime) : int
Parameters
$dateTime : Datetime
Tags
checked
noTodo
unitTest
Return values
int

hardDeleteWithAssoc()

コンテンツ情報と紐付いてるモデルを削除する

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

isAllowPublish()

公開状態を取得する

public isAllowPublish(Content $content[, mixed $self = false ]) : bool
Parameters
$content : Content

コンテンツデータ

$self : mixed = false
Tags
checked
noTodo
unitTest
Return values
bool

公開状態

isChangedStatus()

タイトル、URL、公開状態が更新されているか確認する

public isChangedStatus(int $id, array<string|int, mixed> $newData) : bool
Parameters
$id : int

コンテンツID

$newData : array<string|int, mixed>

新しいコンテンツデータ

Tags
checked
noTodo
unitTest
Return values
bool

isMovable()

移動元のコンテンツと移動先のディレクトリから移動が可能かチェックする

public isMovable(int $currentId, int $targetParentId) : bool
Parameters
$currentId : int

int 移動元コンテンツID

$targetParentId : int

int 移動先コンテンツID (ContentFolder)

Tags
checked
noTodo
unitTest
Return values
bool

isPublishById()

ID を指定して公開状態かどうか判定する

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

move()

コンテンツを移動する

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

基本的に targetId の上に移動する前提となる targetId が空の場合は、同親中、一番下に移動する

Parameters
$origin : array<string|int, mixed>
$target : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
Content|bool|false

publish()

公開状態にする

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

restore()

論理削除されたコンテンツを復元する

public restore(int $id) : EntityInterface|array<string|int, mixed>|null
Parameters
$id : int
Tags
checked
noTodo
unitTest
Return values
EntityInterface|array<string|int, mixed>|null

$trash

restoreAll()

ゴミ箱内のコンテンツをすべて元に戻す

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

$count

setConditions()

setConditions

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

setTreeConfig()

TreeBehaviorの設定値を更新する

public setTreeConfig(string $targetConfig, array<string|int, mixed> $conditions) : TreeBehavior
Parameters
$targetConfig : string
$conditions : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
TreeBehavior

unpublish()

非公開状態にする

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

update()

編集する

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

        
On this page

Search results