Created
June 24, 2016 11:33
-
-
Save eminetto/52e77ad749e5cef7bcd6455579c66f68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function unsubscribe($user, $category) | |
{ | |
if (!$this->isUserLockable($user)) { | |
return [ | |
'type' => 'error', | |
'message' => 'Algo deu errado. O usuário ' . $user['name'] . ' parece não ser passível de bloqueio.' | |
]; | |
} | |
if (!$this->isCategoryLockable($category)) { | |
return [ | |
'type' => 'error', | |
'message' => 'Algo deu errado. A categoria ' . $category['name'] . ' parece não ser passível de bloqueio.' | |
]; | |
} | |
if (!$this->isUserAndCategoryLocked($user, $category)) { | |
return [ | |
'type' => 'success', | |
'message' => 'Pronto! Você não receberá mais ' . $category['name'] . ' de ' . $user['name'] . '. Para reativar o recebimento dessas mensagens, <a href="' . $this->getRequest()->getBasePath() . '/messages/setting">acesse suas configurações</a>q' | |
]; | |
} | |
return [ | |
'type' => 'success', | |
'message' => 'Você não está recebendo ' . $category['name'] . ' de ' . $user['name'] . '.' | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment