Jump to:

7937 Posts in 1537 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » FileDataObjectManager $fieldlist question

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 592 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    FileDataObjectManager $fieldlist question Link to this post

    I was wondering how to get the Filename of the attached file. My DataObject Video with $has_one = array('Attachment' => 'FLV').

    On my ManyManyFileDataObjectManager I have

    $filelist = array('Name' => 'Name')

    but that doesn't work because Video doesn't have a Name Column in the database. I thought that putting a function on Video like this

    function Name() {return $this->Attachment()->Name;} would do it but it doesn't

  • UncleCheese
    Avatar
    4085 Posts

    Re: FileDataObjectManager $fieldlist question Link to this post

    Hi, Micah! Welcome back!

    Change the name of the function to "getName()", and that should do it.

    592 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.