<?php
namespace SabaiApps\Directories\Component\Entity\DisplayLabel;

use SabaiApps\Directories\Component\Display;
use SabaiApps\Directories\Component\Entity\Model\Bundle;
use SabaiApps\Directories\Component\Entity\Type\IEntity;

class FeaturedEntityDisplayLabel extends Display\Label\AbstractLabel {

	protected function _displayLabelInfo( Bundle $bundle ) {
		return array(
			'label'            => __( 'Featured item label', 'directories-pro' ),
			'default_settings' => array(
				'_label' => _x( 'Featured', 'featured label', 'directories-pro' ),
				'_color' => array( 'type' => 'warning' ),
			),
		);
	}

	public function displayLabelText( Bundle $bundle, IEntity $entity, array $settings ) {
		if ( ! $entity->isFeatured() ) {
			return;
		}

		return array(
			'label' => $settings['_label'],
			'color' => $settings['_color'],
		);
	}
}
