original_string: public function beforeValidate()
      {
          /* @var $model ActiveRecord */
          $model = $this->owner;
          foreach ($this->attributes as $attr => $options) {
              $this->ensureAttributes($attr, $options);
              if ($file = UploadedFile::getInstance($model, $attr)) {
                  $model->{$attr} = $file;
              }
          }
      }
code: public function beforeValidate()
      {
          /* @var $model ActiveRecord */
          $model = $this->owner;
          foreach ($this->attributes as $attr => $options) {
              $this->ensureAttributes($attr, $options);
              if ($file = UploadedFile::getInstance($model, $attr)) {
                  $model->{$attr} = $file;
              }
          }
      }
code_tokens: public function beforeValidate ( ) { /* @var $model ActiveRecord */ $ model = $ this -> owner ; foreach ( $ this -> attributes as $ attr => $ options ) { $ this -> ensureAttributes ( $ attr , $ options ) ; if ( $ file = UploadedFile :: getInstance ( $ model , $ attr ) ) { $ model -> { $ attr } = $ file ; } } }
docstring: function for EVENT_BEFORE_VALIDATE
docstring_tokens: function for EVENT_BEFORE_VALIDATE