code/Forms/AssetFormFactory.php
protected function getPath($record, $context = [])
    {
        if ($record && $record->isInDB()) {
            if ($record->ParentID) {
                return $record->Parent()->getFilename();
            } else {
                return '/';
            }
        }
        if (isset($context['ParentID'])) {
            if ($context['ParentID'] === 0) {
                return '/';
            }
            /** @var File $file */
            $file = File::get()->byID($context['ParentID']);
            if ($file) {
                return $file->getFilename();
            }
        }
        return null;
    }
protected function getPath($record, $context = [])
    {
        if ($record && $record->isInDB()) {
            if ($record->ParentID) {
                return $record->Parent()->getFilename();
            } else {
                return '/';
            }
        }
        if (isset($context['ParentID'])) {
            if ($context['ParentID'] === 0) {
                return '/';
            }
            /** @var File $file */
            $file = File::get()->byID($context['ParentID']);
            if ($file) {
                return $file->getFilename();
            }
        }
        return null;
    }
protected function getPath ( $ record , $ context = [ ] ) { if ( $ record && $ record -> isInDB ( ) ) { if ( $ record -> ParentID ) { return $ record -> Parent ( ) -> getFilename ( ) ; } else { return '/' ; } } if ( isset ( $ context [ 'ParentID' ] ) ) { if ( $ context [ 'ParentID' ] === 0 ) { return '/' ; } /** @var File $file */ $ file = File :: get ( ) -> byID ( $ context [ 'ParentID' ] ) ; if ( $ file ) { return $ file -> getFilename ( ) ; } } return null ; }
Get user-visible "Path" for this record

@param File $record
@param array $context
@return string
Get user - visible Path for this record