PHP Class lithium\g11n\catalog\Adapter

Inheritance: extends lithium\core\Object
Afficher le fichier Open project: unionofrad/lithium Class Usage Examples

Méthodes publiques

Méthode Description
read ( string $category, string $locale, string $scope ) : null Reads data.
write ( string $category, string $locale, string $scope, array $data ) : false Writes data.

Méthodes protégées

Méthode Description
_merge ( array $data, array $item ) : array Merges an item into given data.
_prepareForWrite ( array $item ) : array Prepares an item before it is being written.

Method Details

_merge() protected méthode

Merges an item into given data.
protected _merge ( array $data, array $item ) : array
$data array Data to merge item into.
$item array Item to merge into $data. The item must have an `'id'` key.
Résultat array The merged data.

_prepareForWrite() protected méthode

Override this method in sublcasses if you need to i.e. escape the item's values.
protected _prepareForWrite ( array $item ) : array
$item array
Résultat array

read() public méthode

Override this method in subclasses if you want the adapter to have read support. The method is expected to return null if the passed category is not supported.
public read ( string $category, string $locale, string $scope ) : null
$category string A category.
$locale string A locale identifier.
$scope string The scope for the current operation.
Résultat null This currently does nothing.

write() public méthode

Override this method in subclasses if you want the adapter to have write support. The method is expected to return false if the passed category is not supported. Please note that existing data is silently overwritten.
public write ( string $category, string $locale, string $scope, array $data ) : false
$category string A category.
$locale string A locale identifier.
$scope string The scope for the current operation.
$data array The data to write.
Résultat false This currently does nothing.