Skip to content

Commit

Permalink
Creation of notification in CLI will work close #1
Browse files Browse the repository at this point in the history
  • Loading branch information
maxailloud committed Feb 4, 2014
1 parent 23b6f06 commit 42e9215
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Service/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,16 @@ public function createNotification(NotifiableInterface $notifiable)
$doerId = null;

if ($doer === null) {
$doer = $this->security->getToken()->getUser();
$securityToken = $this->security->getToken();

if (null !== $securityToken) {
$doer = $securityToken->getUser();
}
}
if ($doer !== null) {
$doerId = $doer->getId();
}

if (!isset($details['doer']) && !empty($doerId)) {
$details['doer'] = array(
'id' => $doerId,
Expand Down

0 comments on commit 42e9215

Please sign in to comment.