\BEAR_Agent_Adapter_Default

Defaultエージェントアダプター

BEARフレームワークで使われる基底クラスです。

BEARのクラスはBEAR::factoryやBEAR::dependency()によって以下の順でインスタンス化されます。

1) コンストラクタで設定を行う 2) 設定に基づいてインジェクタで必要なサービスをプロパティに用意

Summary

Methods
Properties
Constants
onUTF8()
__construct()
onInject()
setConfig()
getConfig()
setService()
No public properties found
MOBILE_SUBMIT_PASS
MOBILE_SUBMIT_ENTITY
MOBILE_SUBMIT_REMOVE_EMOJI
_exception()
$_config
N/A
No private methods found
No private properties found
N/A

Constants

MOBILE_SUBMIT_PASS

MOBILE_SUBMIT_PASS

携帯絵文字サブミット無変換

MOBILE_SUBMIT_ENTITY

MOBILE_SUBMIT_ENTITY

携帯絵文字サブミット無変換

MOBILE_SUBMIT_REMOVE_EMOJI

MOBILE_SUBMIT_REMOVE_EMOJI

携帯絵文字サブミット除去

Properties

$_config

$_config : array

Class config

Type

array

Methods

onUTF8()

onUTF8(  $value, string  $key, string  $inputEncode) : void

UTF-8化コールバック関数

$this->_config['input_encode']からUTF-8に変換します。
mb_check_encoding()関数でコードが適切が判断され問題があると例外が投げられます

Parameters

$value
string $key

キー

string $inputEncode

エンコード

Throws

\BEAR_Agent_Exception

__construct()

__construct(array  $config) 

Constructor

Parameters

array $config

onInject()

onInject() : void

Inject

設定にしたがってサービスをインジェクトします。

setConfig()

setConfig(mixed  $config, mixed  $values = null) : self

Set config

Parameters

mixed $config

(string) 設定キー | (array) 設定配列

mixed $values

(string) $configの時の設定値

Returns

self

getConfig()

getConfig(string  $key = null) : mixed

Get config

Parameters

string $key

設定キー、指定なければ全ての設定を取得

Returns

mixed

setService()

setService(string  $name, mixed  $service) : void

Set service

Parameters

string $name

サービスキー

mixed $service

サービス

_exception()

_exception(string  $msg, array  $config = array()) : \BEAR_Exception

例外の作成

Parameters

string $msg

例外メッセージ

array $config

例外config

Returns

\BEAR_Exception