public function getMailList() { $id = Input::get('memberId'); if ($id === null) { $e = new InvalidArgumentHttpException(); $e->setMessage('회원 번호를 입력해야 합니다.'); throw $e; } $mails = $this->mails->fetchAll(['memberId' => $id]); return Presenter::makeApi(['mails' => $mails]); }
public function getMailList() { $member = $this->member; $mails = $member->mails; if ($mails === null) { $mails = $this->mails->fetchAll(['memberId' => $member->getId()]); } else { $mails = array_values($mails); } return Presenter::makeApi(['mails' => $mails]); }