\CurrentBase

Current Utility

NetCommonsの機能として必要な情報を保持します。
NetCommonsAppController::beforeFilter で初期処理が呼び出され、値が設定されます。
値を取得する時は、readメソッドを使用します。
権限を取得する時は、permissionメソッドを使用します。

保持データ

Array(
    [User] => Array(
        [id] => 1
        [username] => admin
        [key] => 640f981d6104fd21463d674f18477348
        [avatar] =>
        [avatar_file_id] =>
        [is_avatar_public] =>
        [handlename] => admin
        [is_handlename_public] =>
        [is_name_public] =>
        [email] =>
        [is_email_public] =>

        ・・・

        [Role] => Array(
            [id] => 1
            [language_id] => 2
            [key] => system_administrator
            [type] => 1
            [name] => システム管理者
            [is_system] => 1
        )
    )

    [Language] => Array(
        [id] => 2
        [code] => ja
        [weight] => 2
        [is_active] => 1
    )

    [PluginsRole] => Array(
        [13] => Array(
            [id] => 13
            [role_key] => system_administrator
            [plugin_key] => rooms
        )

        [20] => Array(
            [id] => 20
            [role_key] => system_administrator
            [plugin_key] => user_manager
        )

    )

    [Page] => Array(
        [id] => 1
        [room_id] => 1
        [parent_id] =>
        [lft] => 1
        [rght] => 2
        [permalink] =>
        [slug] =>
        [is_published] => 1
        [from] =>
        [to] =>
        [is_container_fluid] =>
    )

    [Room] => Array(
        [id] => 1
        [space_id] => 2
        [page_id_top] => 1
        [parent_id] =>
        [lft] => 1
        [rght] => 2
        [active] => 1
        [default_role_key] => visitor
        [need_approval] => 1
        [default_participation] => 1
        [page_layout_permitted] => 1
    )

    [ParentPage] => Array(
        ・・・
    )

    [RolesRoomsUser] => Array(
        ・・・
    )

    [RolesRoom] => Array(
        ・・・
    )

・・・

    [Permission] => Array(
        [page_editable] => Array(
            [id] => 9
            [role_key] => room_administrator
            [type] => room_role
            [permission] => page_editable
            [value] => 1
            [fixed] => 1
            [roles_room_id] => 1
        )

        [block_editable] => Array(
            ・・・
        )

        [content_readable] => Array(
            ・・・
        )

        [content_creatable] => Array(
            ・・・
        )

        [content_editable] => Array(
            ・・・
        )

        [content_publishable] => Array(
            ・・・
        )

        [content_comment_creatable] => Array(
            ・・・
        )

        [content_comment_editable] => Array(
            ・・・
        )

        [content_comment_publishable] => Array(
            ・・・
        )

        [block_permission_editable] => Array(
            ・・・
        )

        [html_not_limited] => Array(
            ・・・
        )

    )

    [Plugin] => Array(
        [id] => 5
        [language_id] => 2
        [key] => announcements
        [name] => お知らせ
        [namespace] => netcommons/announcements
        [weight] =>
        [type] => 1
        [default_action] => announcements/view
        [default_setting_action] => announcement_blocks/index
    )

    [Frame] => Array(
        [id] => 1
        [language_id] => 2
        [room_id] => 1
        [box_id] => 3
        [plugin_key] => announcements
        [block_id] => 1
        [key] => frame_1
        [name] => お知らせ
        [header_type] => default
        [translation_engine] =>
        [is_first_auto_translation] =>
        [is_auto_translated] =>
        [weight] => 1
        [is_deleted] =>
    )

    [Box] => Array(
        [id] => 3
        [container_id] => 3
        [type] => 4
        [space_id] =>
        [room_id] => 1
        [page_id] => 1
        [weight] => 1
    )

    [Block] => Array(
        [id] => 1
        [language_id] => 2
        [room_id] => 1
        [plugin_key] => announcements
        [key] => block_1
        [name] => NetCommons 3! セッティングモードで編集しよう.
        [public_type] => 1
        [from] =>
        [to] =>
        [translation_engine] =>
        [is_auto_translated] =>
        [is_first_auto_translation] =>
    )
)

Summary

Methods
Properties
Constants
read()
raedOriginal()
write()
writeOriginal()
remove()
permission()
$current
$originalCurrent
$permission
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$current

$current : array

Current data

Type

array

$originalCurrent

$originalCurrent : array

Current data

Type

array

$permission

$permission : array

Permission data

Type

array

Methods

read()

read(string|null  $key = null, mixed  $default = null) : array|null

指定された$keyの値を返します。

現在のBlockKeyを取得したい場合

Cuurent::read('Block.key')

Parameters

string|null $key

Hashクラスのpath

mixed $default

デフォルト値

Returns

array|null —

Current data.

raedOriginal()

raedOriginal(string|null  $key = null, mixed  $default = null) : array|null

指定された$keyの値を$originalCurrentから返します。

現在のBlockKeyを取得したい場合

Cuurent::readOrignal('Block.key')

Parameters

string|null $key

Hashクラスのpath

mixed $default

デフォルト値

Returns

array|null —

Current data.

write()

write(string|null  $key, \mixted  $value) : void

指定された$keyの値をセットします

現在のBlockKeyをセットしたい場合

Cuurent::write('Block.key', 'block_key)

Parameters

string|null $key

Hashクラスのpath、nullの場合、Hash::mergeする

\mixted $value

セットする値

writeOriginal()

writeOriginal(string|null  $key, \mixted  $value) : void

指定された$keyの値を$originalCurrentにセットします

現在のBlockKeyをセットしたい場合

Cuurent::writeOriginal('Block.key', 'block_key)

Parameters

string|null $key

Hashクラスのpath、nullの場合、Hash::mergeする

\mixted $value

セットする値

remove()

remove(string|null  $key = null) : array|null

指定された$keyの値を削除します。

現在のBlockKeyを削除したい場合

Cuurent::remove('Block.key')

Parameters

string|null $key

Hashクラスのpath

Returns

array|null —

Current data.

permission()

permission(string  $key, integer|null  $roomId = null) : boolean

指定された$key(権限名文字列)の値を返します。

Current::permission('content_publishable')

Parameters

string $key

Hashクラスのpath

integer|null $roomId

ルームID

Returns

boolean —

permission value