Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }