Jump to:

7938 Posts in 1540 Topics by 945 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: 605 Views
  • micahsheets
    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
    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.

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.