yupe\components\behaviors\FileUploadBehavior::beforeSave PHP Method

beforeSave() public method

public beforeSave ( CModelEvent $event ) : boolean
$event CModelEvent
return boolean
    public function beforeSave($event)
    {
        if ($this->checkScenario() && $this->getUploadedFileInstance() instanceof CUploadedFile) {
            $this->removeFile();
            $this->saveFile();
        }
        if ($this->checkScenario() && Yii::app()->getRequest()->getPost($this->deleteFileKey)) {
            $this->removeFile();
            $this->getOwner()->{$this->attributeName} = null;
        }
        parent::beforeSave($event);
    }