public function setAllowed($allowed) { if (!is_array($allowed)) { $allowed = array_map('trim', explode(',', $allowed)); } $this->allowed = array_intersect($allowed, array('long', 'short', 'short-echo')); return $this; }