<commit_before><?php

use Airtime\MediaItem\Playlist;

use Airtime\MediaItem\PlaylistPeer;

class Presentation_Playlist {
	
	const LENGTH_FORMATTER_CLASS = "Format_HHMMSSULength";
	
	public function __construct($playlist) {
		
		$this->playlist = $playlist;
	}
	
	public function getId() {
		
		return $this->playlist->getId();
	}
	
	public function getName() {
		
		return $this->playlist->getName();
	}
	
	public function getDescription() {
		
		return $this->playlist->getDescription();
	}
	
	public function getLastModifiedEpoch() {
		
		return $this->playlist->getUpdatedAt("U");
	}
	
	public function getLength() {
		
		$length = $this->playlist->getLength();
		$class = self::LENGTH_FORMATTER_CLASS;
		$formatter = new $class($length);
		
		return $formatter->format(3);
	}
	
	public function hasContent() {
		
		$type = $this->playlist->getClassKey();
		
		return $type === intval(PlaylistPeer::CLASSKEY_0) ? true: false;
	}
	
	public function getContent() {
		
		if ($this->hasContent()) {
			return $this->playlist->getContents();
		}<commit_msg>CC-5762 : Playlist options validation<commit_after><?php

use Airtime\MediaItem\Playlist;

use Airtime\MediaItem\PlaylistPeer;

class Presentation_Playlist {
	
	const LENGTH_FORMATTER_CLASS = "Format_HHMMSSULength";
	
	public function __construct($playlist) {
		
		$this->playlist = $playlist;
	}
	
	public function getId() {
		
		return $this->playlist->getId();
	}
	
	public function getName() {
		
		return $this->playlist->getName();
	}
	
	public function getDescription() {
		
		return $this->playlist->getDescription();
	}
	
	public function getLastModifiedEpoch() {
		
		return $this->playlist->getUpdatedAt("U");
	}
	
	public function getLength() {
		
		$formatter = new Format_PlaylistLength($this->playlist);
		return $formatter->getLength();
	}
	
	public function hasContent() {
		
		$type = $this->playlist->getClassKey();
		
		return $type === intval(PlaylistPeer::CLASSKEY_0) ? true: false;
	}
	
	public function getContent() {
		
		if ($this->hasContent()) {
			return $this->playlist->getContents();
		}
{'fraction_non_alphanumeric': 0.14265060240963856, 'fraction_numerical': 0.0033734939759036144, 'mean_word_length': 4.138613861386139, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7246194', 'n_tokens_mistral': 767, 'n_tokens_neox': 646, 'n_words': 127}