/** * Is Text? * * @param array $data Attachment data * @return boolean True if attachment is text */ public function is_text($data = false) { if (!$data) { $data = $this->data; } App::uses('MimeType', 'Model'); return MimeType::is_type('text', $this->data[$this->alias]['filename']); }