addColumn('no', 'no'); $this->addColumn('date', 'added', [ 'title' => 'Sent At', 'orderBy' => 'added', 'format' => '%m/%d/%Y %I:%M %p', ]); if ($this->hasReceiverColumn()) { $this->addColumn('member', 'to', ['label' => 'To', 'orderBy' => 'receiverFullName', 'params' => [ 'name' => 'receiverFullName', 'alias' => 'receiverAlias', ]]); } if ($this->hasSenderColumn()) { $this->addColumn('member', 'from', ['label' => 'from', 'orderBy' => 'senderFullName', 'params' => [ 'name' => 'senderFullName', 'alias' => 'senderAlias', ]]); } $this->addColumn('link', 'subject', [ 'url' => $this->getUrl() . '/', 'params' => ['title' => 'subject', 'id' => 'id'] ]); return $this; } public function hasReceiverColumn() { return $this->receiverColumn; } public function setReceiverColumn($receiverColumn) { $this->receiverColumn = $receiverColumn; return $this; } public function hasSenderColumn() { return $this->senderColumn; } public function setSenderColumn($senderColumn) { $this->senderColumn = $senderColumn; return $this; } public function getUrl() { return $this->url; } public function setUrl($url) { $this->url = $url; return $this; } }