ContentsController
extends BcAdminApiController
in package
Class ContentsController
Table of Contents
- $Authentication : AuthenticationComponent
- $Authentication : AuthenticationComponent
- $BcMessage : BcMessageComponent
- $Paginator : PaginatorComponent
- $Security : SecurityComponent
- $_View : View
- View
- __construct() : mixed
- BcAppController constructor.
- _blackHoleCallback() : void
- Securityコンポーネントのブラックホールからのコールバック
- add_alias() : void
- add_alias
- batch() : void
- batch
- beforeFilter() : Response|void
- Before Filter
- beforeRender() : Response|void|null
- Before render
- change_status() : mixed
- 公開状態を変更する
- delete() : mixed
- コンテンツ情報削除(論理削除) ※ 子要素があれば、子要素も削除する
- dispatchLayerEvent() : bool|Event
- イベントを発火
- edit() : mixed
- コンテンツ情報編集
- exists() : mixed
- 指定したIDのコンテンツが存在するか確認する ゴミ箱のものは無視
- get_content_folder_list() : mixed
- サイトに紐付いたフォルダリストを取得
- get_full_url() : mixed
- get_full_url
- getAccessToken() : array<string|int, mixed>
- トークンを取得する
- getService() : array<string|int, mixed>|mixed|object
- Get Service
- hasService() : bool
- Has Service
- index() : void
- コンテンツ情報一覧取得
- index_trash() : void
- ゴミ箱内のコンテンツ一覧を取得する
- initialize() : void
- Initialize
- is_unique_content() : Response
- 指定したURLのパス上のコンテンツでフォルダ以外が存在するか確認
- isAdminApiEnabled() : bool
- 認証が必要なAPIを利用可能かどうか判定
- isAvailableUser() : bool
- ログインユーザーが有効か判定する
- move() : void
- 並び順を移動する
- notFound() : void
- NOT FOUNDページを出力する
- redirectIfIsRequireMaintenance() : Response|void|null
- メンテナンス画面へのリダイレクトが必要な場合にリダイレクトする
- rename() : void
- リネーム
- setTitle() : void
- Set Title
- setupFrontView() : void
- フロント用のViewクラスをセットアップする
- trash_empty() : void
- ゴミ箱を空にする(物理削除)
- trash_return() : mixed
- trash_return
- view() : mixed
- コンテンツ情報取得
- view_trash() : mixed
- ゴミ箱情報取得
- _autoConvertEncodingByArray() : array<string|int, mixed>
- 配列の文字コードを変換する
- loadViewConditions() : void
- 画面の情報をセッションから読み込む
- saveViewConditions() : void
- 画面の情報をセッションに保存する
- setViewConditions() : void
- 画面の情報をセットする
- __cleanupQueryParams() : void
- クエリーパラメーターの調整 環境によって?キーにamp;が付加されてしまうため
- __convertEncodingHttpInput() : void
- http経由で送信されたデータを変換する とりあえず、UTF-8で固定
- checkPermission() : bool
- アクセスルールの権限を確認する
Properties
$Authentication
public
AuthenticationComponent
$Authentication
$Authentication
public
AuthenticationComponent
$Authentication
$BcMessage
public
BcMessageComponent
$BcMessage
$Paginator
public
PaginatorComponent
$Paginator
$Security
public
SecurityComponent
$Security
$_View
View
protected
View
$_View
Methods
__construct()
BcAppController constructor.
public
__construct([ServerRequest|null $request = null ][, Response|null $response = null ][, string|null $name = null ][, EventManagerInterface|null $eventManager = null ][, ComponentRegistry|null $components = null ]) : mixed
Parameters
- $request : ServerRequest|null = null
- $response : Response|null = null
- $name : string|null = null
- $eventManager : EventManagerInterface|null = null
- $components : ComponentRegistry|null = null
Tags
Return values
mixed —_blackHoleCallback()
Securityコンポーネントのブラックホールからのコールバック
public
_blackHoleCallback(string $err, mixed $exception) : void
フォーム改ざん対策・CSRF対策・SSL制限・HTTPメソッド制限などへの違反が原因で Securityコンポーネントに"ブラックホールされた"場合の動作を指定する
Parameters
- $err : string
-
エラーの種類
- $exception : mixed
Tags
Return values
void —add_alias()
add_alias
public
add_alias(ContentsServiceInterface $service) : void
Parameters
- $service : ContentsServiceInterface
Tags
Return values
void —batch()
batch
public
batch(ContentsServiceInterface $service) : void
Parameters
- $service : ContentsServiceInterface
Tags
Return values
void —beforeFilter()
Before Filter
public
beforeFilter(EventInterface $event) : Response|void
Parameters
- $event : EventInterface
Tags
Return values
Response|void —beforeRender()
Before render
public
beforeRender(EventInterface $event) : Response|void|null
Parameters
- $event : EventInterface
Tags
Return values
Response|void|null —change_status()
公開状態を変更する
public
change_status(ContentsServiceInterface $service) : mixed
Parameters
- $service : ContentsServiceInterface
Tags
Return values
mixed —delete()
コンテンツ情報削除(論理削除) ※ 子要素があれば、子要素も削除する
public
delete(ContentsServiceInterface $service[, mixed $id = null ]) : mixed
Parameters
- $service : ContentsServiceInterface
- $id : mixed = null
Tags
Return values
mixed —dispatchLayerEvent()
イベントを発火
public
dispatchLayerEvent(string $name[, array<string|int, mixed> $data = [] ][, mixed $options = [] ]) : bool|Event
Parameters
- $name : string
- $data : array<string|int, mixed> = []
- $options : mixed = []
Tags
Return values
bool|Event —edit()
コンテンツ情報編集
public
edit(ContentsServiceInterface $service, int $id) : mixed
Parameters
- $service : ContentsServiceInterface
- $id : int
Tags
Return values
mixed —exists()
指定したIDのコンテンツが存在するか確認する ゴミ箱のものは無視
public
exists(ContentsServiceInterface $service, int $id) : mixed
Parameters
- $service : ContentsServiceInterface
- $id : int
Tags
Return values
mixed —get_content_folder_list()
サイトに紐付いたフォルダリストを取得
public
get_content_folder_list(ContentsServiceInterface $service, int $siteId) : mixed
Parameters
- $service : ContentsServiceInterface
- $siteId : int
Tags
Return values
mixed —get_full_url()
get_full_url
public
get_full_url(ContentsServiceInterface $service, int $id) : mixed
Parameters
- $service : ContentsServiceInterface
- $id : int
Tags
Return values
mixed —getAccessToken()
トークンを取得する
public
getAccessToken(ResultInterface $result) : array<string|int, mixed>
Parameters
- $result : ResultInterface
Tags
Return values
array<string|int, mixed> —getService()
Get Service
public
getService( $service) : array<string|int, mixed>|mixed|object
Parameters
Tags
Return values
array<string|int, mixed>|mixed|object —hasService()
Has Service
public
hasService( $service) : bool
Parameters
Tags
Return values
bool —index()
コンテンツ情報一覧取得
public
index(ContentsServiceInterface $service) : void
Parameters
- $service : ContentsServiceInterface
Tags
Return values
void —index_trash()
ゴミ箱内のコンテンツ一覧を取得する
public
index_trash(ContentsService $service) : void
Parameters
- $service : ContentsService
Return values
void —initialize()
Initialize
public
initialize() : void
Tags
Return values
void —is_unique_content()
指定したURLのパス上のコンテンツでフォルダ以外が存在するか確認
public
is_unique_content(ContentsServiceInterface $service) : Response
Parameters
- $service : ContentsServiceInterface
Tags
Return values
Response —isAdminApiEnabled()
認証が必要なAPIを利用可能かどうか判定
public
isAdminApiEnabled() : bool
Return values
bool —isAvailableUser()
ログインユーザーが有効か判定する
public
isAvailableUser() : bool
サービスクラス、または、テーブルクラスにおいて、isAvailable / get メソッドが 存在するかを確認し、あれば実行し、その結果を返す。 ない場合は、 true を返却する
Return values
bool —move()
並び順を移動する
public
move(ContentsService $service) : void
Parameters
- $service : ContentsService
Tags
Return values
void —notFound()
NOT FOUNDページを出力する
public
notFound() : void
Tags
Return values
void —redirectIfIsRequireMaintenance()
メンテナンス画面へのリダイレクトが必要な場合にリダイレクトする
public
redirectIfIsRequireMaintenance() : Response|void|null
Tags
Return values
Response|void|null —rename()
リネーム
public
rename(ContentsService $service) : void
新規登録時の初回リネーム時は、name にも保存する
Parameters
- $service : ContentsService
Tags
Return values
void —setTitle()
Set Title
public
setTitle(string $title) : void
Parameters
- $title : string
Tags
Return values
void —setupFrontView()
フロント用のViewクラスをセットアップする
public
setupFrontView() : void
Tags
Return values
void —trash_empty()
ゴミ箱を空にする(物理削除)
public
trash_empty(ContentsServiceInterface $service) : void
Parameters
- $service : ContentsServiceInterface
Tags
Return values
void —trash_return()
trash_return
public
trash_return(ContentsServiceInterface $service, int $id) : mixed
コンテンツ情報を元に戻す
Parameters
- $service : ContentsServiceInterface
- $id : int
Tags
Return values
mixed —view()
コンテンツ情報取得
public
view(ContentsServiceInterface $service, int $id) : mixed
Parameters
- $service : ContentsServiceInterface
- $id : int
Tags
Return values
mixed —view_trash()
ゴミ箱情報取得
public
view_trash(ContentsServiceInterface $service, int $id) : mixed
Parameters
- $service : ContentsServiceInterface
- $id : int
Tags
Return values
mixed —_autoConvertEncodingByArray()
配列の文字コードを変換する
protected
_autoConvertEncodingByArray(array<string|int, mixed> $data[, string $outenc = 'UTF-8' ]) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
-
変換前データ
- $outenc : string = 'UTF-8'
-
変換後の文字コード
Tags
Return values
array<string|int, mixed> —変換後データ
loadViewConditions()
画面の情報をセッションから読み込む
protected
loadViewConditions([array<string|int, mixed> $targetModel = [] ][, array<string|int, mixed>|string $options = [] ]) : void
初期値が設定されている場合は初期値を設定した上で、セッションで上書きし、 ServerRequestに設定する。
Parameters
- $targetModel : array<string|int, mixed> = []
- $options : array<string|int, mixed>|string = []
-
オプション
-
default
: 読み出す初期値(初期値:[]) -
group
: 保存するグループ名(初期値:'') -
post
: POSTデータを保存するかどうか(初期値:true) -
get
: GETデータを保存するかどうか(初期値:false)
-
Tags
Return values
void —saveViewConditions()
画面の情報をセッションに保存する
protected
saveViewConditions([array<string|int, mixed> $targetModel = [] ][, array<string|int, mixed> $options = [] ]) : void
次のセッション名に保存。
- POSTデータ: BcApp.viewConditions.{$contentsName}.data.{$model}
- クエリパラメーター: BcApp.viewConditions.{$contentsName}.query
$contentsNameは次の形式となる。 {$controllerName}{$actionName}.{$group}
ただし、ページネーションにおいて、1ページ目はクエリパラメーターpage
を付けない仕様となっているため
page
は保存しない。
Parameters
- $targetModel : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
-
オプション
-
group
: 保存するグループ名(初期値:'') -
post
: POSTデータを保存するかどうか(初期値:true) -
get
: GETデータを保存するかどうか(初期値:false)
-
Tags
Return values
void —setViewConditions()
画面の情報をセットする
protected
setViewConditions([array<string|int, mixed> $targetModel = [] ][, array<string|int, mixed> $options = [] ]) : void
POSTデータとクエリパラメーターをセッションに保存した上で、 指定されたデフォルト値も含めて ServerRequest に設定する。
$this->setViewConditions(['Content'], [
'group' => 'index',
'default' => [
'query' => ['limit' => 10],
'data' => ['title' => 'default']
],
'get' => true
]);
Parameters
- $targetModel : array<string|int, mixed> = []
-
ターゲットとなるモデル
- $options : array<string|int, mixed> = []
-
オプション
-
default
: 読み出す初期値(初期値:[]) -
group
: 保存するグループ名(初期値:'') -
post
: POSTデータを保存するかどうか(初期値:true) -
get
: GETデータを保存するかどうか(初期値:false)
-
Tags
Return values
void —__cleanupQueryParams()
クエリーパラメーターの調整 環境によって?キーにamp;が付加されてしまうため
private
__cleanupQueryParams() : void
Tags
Return values
void —__convertEncodingHttpInput()
http経由で送信されたデータを変換する とりあえず、UTF-8で固定
private
__convertEncodingHttpInput() : void
Tags
Return values
void —checkPermission()
アクセスルールの権限を確認する
private
checkPermission() : bool
現在アクセスしているURLについて権限があるかどうかを確認する。