yii\mongodb\file\ActiveRecord::refreshFile PHP Method

refreshFile() public method

Refreshes the [[file]] attribute from file collection, using current primary key.
public refreshFile ( ) : MongoGridFSFile | null
return MongoGridFSFile | null refreshed file value.
    public function refreshFile()
    {
        $mongoFile = $this->getCollection()->get($this->getPrimaryKey());
        $this->setAttribute('file', $mongoFile);
        return $mongoFile;
    }