\DevOwl\MultilingualLanguageDependingOption

Make a given option langugae-depending. That means, reading a option by a unique name reads the value of the option from the language context. This also works for write.

Note: You need to refactor your update_option_{option} and option_{option} hooks to listen to all changes, perhaps with a startsWith().

Summary

Methods
Properties
Constants
__construct()
pre_option()
pre_update_option()
getComp()
getOriginalOptionName()
getDefault()
getDefaultBehavior()
No public properties found
DEFAULT_USE_NON_EMPTY_FROM_OTHER_LANGUAGES
hooks()
fetchDefaultValue()
getOptionName()
No protected properties found
N/A
No private methods found
$comp
$originalOptionName
$default
$defaultBehavior
N/A

Constants

DEFAULT_USE_NON_EMPTY_FROM_OTHER_LANGUAGES

DEFAULT_USE_NON_EMPTY_FROM_OTHER_LANGUAGES =1

Properties

$originalOptionName

$originalOptionName :

Type

$default

$default :

Type

$defaultBehavior

$defaultBehavior :

Type

Methods

__construct()

__construct(\DevOwl\Multilingual\AbstractSyncPlugin  $comp,string  $originalOptionName,mixed  $default,integer  $defaultBehavior)

C'tor.

Parameters

\DevOwl\Multilingual\AbstractSyncPlugin $comp
string $originalOptionName
mixed $default
integer $defaultBehavior

See DEFAULT_ constants

pre_option()

pre_option(mixed  $pre_option,string  $option)

Read from original value.

Parameters

mixed $pre_option
string $option

pre_update_option()

pre_update_option(mixed  $value,mixed  $old_value,string  $option)

Redirect the update of the context.

Parameters

mixed $value

The new, unserialized option value.

mixed $old_value

The old option value.

string $option

Option name.

getComp()

getComp()

Get AbstractSyncPlugin.

getOriginalOptionName()

getOriginalOptionName()

Get original option name.

getDefault()

getDefault()

Get default value.

getDefaultBehavior()

getDefaultBehavior()

Get default value behavior.

hooks()

hooks()

Initialize hooks.

fetchDefaultValue()

fetchDefaultValue()

Fetch the default behavior.

getOptionName()

getOptionName()

Get option name for this context.