Jump to:

23553 Posts in 19380 Topics by 2892 members

General Questions

SilverStripe Forums » General Questions » Checking for a dataobject that exists

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2
Go to End
Author Topic: 2532 Views
  • Harley
    Community Member
    153 Posts

    Re: Checking for a dataobject that exists Link to this post

    That's fine, not too bothered about the 'hackyness' atleast it works!

    Had to tweak it though, this is crrect line of code

    if($this->Title != "New Page" && !DataObject::get_one('Group', "Title = '$this->Title'")){

    Really happy that this works now. My main problem is that I am primarily a designer, not really a developer and I think I fall down with knowing the correct syntax. I've never used Saphire before, any recommended resources out there for this stuff?

    Thanks again for your help, I'm on the right road now.

    PS looking forward to the SS book arriving this week, good stuff

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.