Jump to:

3431 Posts in 1058 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Force ignore case

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

Page: 1 2
Go to End
Author Topic: 1905 Views
  • MateuszU
    Avatar
    Community Member
    89 Posts

    Re: Force ignore case Link to this post

    DataObjectSet is like an array, it contains a list of DataObjects, and it will not have a Title. First you need to iterate on the DataObjectSet by using:

    if ( $items ) foreach ( $items as $item ) {
    $item->Title;
    }

    or if you just want first item:

    if ( $first = $items->First() ) {
    $first->Title;
    }

    How are you getting your $item? Cause if you get it via get_one you will get proper DataObject and you can query for Title directly. If you do only get, then you will get the set of DataObjects and you need to iterate.

    mat

    1905 Views
Page: 1 2
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.