type = $type; } /** * Transform the Project entity. * * * @return array */ public function transform($model) { switch ($this->type) { case 'list': return $this->lists($model); break; default: return $this->detail($model); break; } } public abstract function lists($model); public abstract function detail($model); }