Ejemplo n.º 1
0
 /**
  * Get options
  *
  * @return array
  */
 public function toOptionArray()
 {
     $options[] = ['label' => '', 'value' => ''];
     $availableOptions = $this->data->getAvailableStatuses();
     foreach ($availableOptions as $key => $value) {
         $options[] = ['label' => $value, 'value' => $key];
     }
     return $options;
 }
Ejemplo n.º 2
0
 /**
  * Get rating value in percents
  * @param  \Swissup\Testimonials\Model\Data $testimonial
  * @return String
  */
 public function getRatingPercent($testimonial)
 {
     $ratingPercent = $testimonial->getRating() / 5 * 100;
     return (string) $ratingPercent;
 }
Ejemplo n.º 3
0
 /**
  * Get profile image path or placeholder
  * @param \Swissup\Testimonials\Model\Data $testimonial
  * @return String
  */
 public function getImagePath($testimonial)
 {
     $image = $testimonial->getImage();
     if (!$image && ($placeholderImage = $this->_configHelper->getPlaceholderImage())) {
         $image = $placeholderImage;
     }
     return $image;
 }