concrete/src/Entity/File/File.php
public function setPassword($pw)
    {
        $fe = new \Concrete\Core\File\Event\FileWithPassword($this);
        $fe->setFilePassword($pw);
        Events::dispatch('on_file_set_password', $fe);

        $this->fPassword = $pw;
        $this->save();
    }
public function setPassword($pw)
    {
        $fe = new \Concrete\Core\File\Event\FileWithPassword($this);
        $fe->setFilePassword($pw);
        Events::dispatch('on_file_set_password', $fe);

        $this->fPassword = $pw;
        $this->save();
    }
public function setPassword ( $ pw ) { $ fe = new \ Concrete \ Core \ File \ Event \ FileWithPassword ( $ this ) ; $ fe -> setFilePassword ( $ pw ) ; Events :: dispatch ( 'on_file_set_password' , $ fe ) ; $ this -> fPassword = $ pw ; $ this -> save ( ) ; }
Sets the access password on a file.

@param $pw string
Sets the access password on a file .