Skip to content

Commit

Permalink
Issue #145
Browse files Browse the repository at this point in the history
Issue #145 - unique the `text` & `notify_body` attributes
  • Loading branch information
Gummibeer committed Jun 4, 2016
2 parents 6cebc9b + 9578a58 commit e22e92b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/Notifynder/Models/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function scopeWherePolymorphic($query, $toId, $type)
/**
* Get parsed body attributes.
*
* @return mixed
* @return string
*/
public function getNotifyBodyAttribute()
{
Expand All @@ -151,6 +151,16 @@ public function getNotifyBodyAttribute()
return $notifynderParse->parse($this);
}

/**
* Get parsed body attributes.
*
* @return string
*/
public function getTextAttribute()
{
return $this->notify_body;
}

/**
* @param $value
* @return \Fenos\Notifynder\Notifications\ExtraParams
Expand Down
3 changes: 2 additions & 1 deletion src/Notifynder/Models/NotifynderCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public function parse()
$parser = new NotifynderParser();

foreach ($this->items as $key => $item) {
$this->items[$key]['text'] = $parser->parse($item);
$this->items[$key]['notify_body'] = $parser->parse($item);
$this->items[$key]['text'] = $this->items[$key]['notify_body'];
}

return $this;
Expand Down

0 comments on commit e22e92b

Please sign in to comment.