Exemplo n.º 1
0
 /**
  */
 protected function unSerialize()
 {
     foreach ($this->attributes as $attribute => $options) {
         $options = array_merge(['class' => File::className(), 'filePath' => $this->path, 'fileUrl' => $this->url, 'folder' => is_string($this->folder) ? $this->folder : function () use($attribute) {
             return call_user_func($this->folder, $this->owner, $attribute, $this);
         }], $options);
         $file = Yii::createObject($options);
         $file->initValue($this->owner->getAttribute($attribute));
         $this->owner->setAttribute($attribute, $file);
     }
 }