Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Checking for a dataobject that exists


Go to End


9 Posts   6434 Views

Avatar
Harley

Community Member, 165 Posts

3 November 2009 at 2:03am

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

Go to Top