Skip to content
Snippets Groups Projects

Message System

Merged William Sutanto requested to merge message_system into 2.2-develop
Viewing commit 78e7617c
Show latest version
4 files
+ 43
7
Preferences
Compare changes
Files
4
@@ -3,8 +3,29 @@ namespace Magento\Messaging\Block;
class Messaging extends \Magento\Framework\View\Element\Template
{
public function getText()
{
/**
* @var \Magento\Framework\App\ObjectManager
*/
public $om;
/**
* @var \Magento\Customer\Model\Session
*/
public $session;
public function getText() {
return 'Hello world!';
}
public function getId() {
if ($om === null || $session === null) {
$om = \Magento\Framework\App\ObjectManager::getInstance();
$session = $om->get('\Magento\Customer\Model\Session');
}
if ($session->isLoggedIn()) {
return $session->getCustomer()->getId();
} else {
return -1;
}
}
}
\ No newline at end of file