/** * 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; }
/** * 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; }
/** * 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; }