3066 Posts in 866 Topics by 648 members
| Go to End | ||
| Author | Topic: | 6374 Views |
-
Re: Does anyone have some examples of DataObject::get and $many_many relationship

18 February 2010 at 5:16pm Last edited: 18 February 2010 5:17pm
thanks for that.....now, one more
is there any way of getting just one (random) DataObject through this method?
ie can you pass anything else to $theSection->Banners("BannerType = '$bannerType'");
-
Re: Does anyone have some examples of DataObject::get and $many_many relationship

18 February 2010 at 8:55pm
Yes, you can.
If I remember correctly it's:
WHERE, SORT, JOIN, LIMITTo get one random Banner you could call:
$theSection->Banners("BannerType = '$bannerType'", 'RAND()', '', '1');
-
Re: Does anyone have some examples of DataObject::get and $many_many relationship

29 November 2011 at 10:14pm
Just wanted to say that I continue to be blown away by how awesome Silverstripe is.. I'm running in circles trying to get some DataObjects all working together and then with a quick search I find out that I literally need to code up:
$d = $cat->Businesses();
Just.. wow
Thanks!
| 6374 Views | ||
| Go to Top |


