original_string: protected function _settingsCallback(Model $model, array $options) {
          if (method_exists($model, 'beforeUpload')) {
              $options = $model->beforeUpload($options);
          }
  
          if ($options['transforms'] && method_exists($model, 'beforeTransform')) {
              foreach ($options['transforms'] as $i => $transform) {
                  $options['transforms'][$i] = $model->beforeTransform($transform);
              }
          }
  
          if ($options['transport'] && method_exists($model, 'beforeTransport')) {
              $options['transport'] = $model->beforeTransport($options['transport']);
          }
  
          return $options;
      }
code: protected function _settingsCallback(Model $model, array $options) {
          if (method_exists($model, 'beforeUpload')) {
              $options = $model->beforeUpload($options);
          }
  
          if ($options['transforms'] && method_exists($model, 'beforeTransform')) {
              foreach ($options['transforms'] as $i => $transform) {
                  $options['transforms'][$i] = $model->beforeTransform($transform);
              }
          }
  
          if ($options['transport'] && method_exists($model, 'beforeTransport')) {
              $options['transport'] = $model->beforeTransport($options['transport']);
          }
  
          return $options;
      }
code_tokens: protected function _settingsCallback ( Model $ model , array $ options ) { if ( method_exists ( $ model , 'beforeUpload' ) ) { $ options = $ model -> beforeUpload ( $ options ) ; } if ( $ options [ 'transforms' ] && method_exists ( $ model , 'beforeTransform' ) ) { foreach ( $ options [ 'transforms' ] as $ i => $ transform ) { $ options [ 'transforms' ] [ $ i ] = $ model -> beforeTransform ( $ transform ) ; } } if ( $ options [ 'transport' ] && method_exists ( $ model , 'beforeTransport' ) ) { $ options [ 'transport' ] = $ model -> beforeTransport ( $ options [ 'transport' ] ) ; } return $ options ; }
docstring: Trigger callback methods to modify attachment settings before uploading.
  
  @param Model $model
  @param array $options
  @return array
docstring_tokens: Trigger callback methods to modify attachment settings before uploading .