3460 Posts in 1064 Topics by 739 members
|Go to End|
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'");
18 February 2010 at 8:55pm
Yes, you can.
If I remember correctly it's:
WHERE, SORT, JOIN, LIMIT
To get one random Banner you could call:
$theSection->Banners("BannerType = '$bannerType'", 'RAND()', '', '1');
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();
|Go to Top|