function getTestimonial()
 {
     if (!$this->testimonial) {
         $this->testimonial = Testimonial::get()->sort("RAND()")->first();
     }
     return $this->testimonial;
 }
 public function Testimonials()
 {
     Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
     Requirements::javascript("silverstripe-testimonials/javascript/jquery.anyslider.min.js");
     Requirements::javascript("silverstripe-testimonials/javascript/main.js");
     return Testimonial::get("Testimonial", array("Approved" => 1), "RAND()");
 }
 function getTestimonials()
 {
     return Testimonial::get();
 }
示例#4
0
 public function GetTestimonial()
 {
     return $testimonial = Testimonial::get()->sort("Created", "DESC")->First() ? $testimonial : false;
 }
 public function Testimonials()
 {
     return Testimonial::get("Testimonial", array("Approved" => 1))->sort("SortOrder");
 }
 public static function get_random($limit = 3)
 {
     return Testimonial::get()->sort("RAND()")->limit($limit);
 }