Skip to content

Instantly share code, notes, and snippets.

@zetas
Created May 25, 2017 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zetas/e30f7efe0ad5a3b10d02c27b1f3de03f to your computer and use it in GitHub Desktop.
Save zetas/e30f7efe0ad5a3b10d02c27b1f3de03f to your computer and use it in GitHub Desktop.
<?php
protected static function _filters($model, $behavior)
{
Filters::apply($model, 'save', function ($params, $next) use ($behavior) {
foreach ($behavior->config('fields') as $field) {
$params['data'][$field] = static::_btcToSatoshi($behavior, $params['entity'], $field);
}
return $next($params);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment