本文整理汇总了PHP中Notification::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::getType方法的具体用法?PHP Notification::getType怎么用?PHP Notification::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::getType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructor
/**
* Tests setting the name and body using the Notification class Constructor.
*/
public function testConstructor()
{
// Create a new Notification using the Constructor to set the note name and body
$note = new Notification('TestNote', 5, 'TestNoteType');
// test assertions
$this->assertTrue($note->getName() == 'TestNote', "Expecting note.getName() == 'TestNote'");
$this->assertTrue($note->getBody() == 5, "Expecting note->getBody() as Number == 5");
$this->assertTrue($note->getType() == 'TestNoteType', "Expecting note->getType() == 'TestNoteType'");
}
示例2: getType
private static function getType(\Notification $n)
{
switch ($n->getType()) {
case NotifyUI::SUCCESS:
return 'SUCCESS';
case NotifyUI::ERROR:
return 'ERROR';
case NotifyUI::WARNING:
return 'WARNING';
default:
return 'UNKNOWN';
}
}
示例3: getType
private static function getType(Notification $n)
{
switch ($n->getType()) {
case INTERN_SUCCESS:
return 'SUCCESS';
case INTERN_ERROR:
return 'ERROR';
case INTERN_WARNING:
return 'WARNING';
default:
return 'UNKNOWN';
}
}
示例4: resolveType
protected function resolveType(\Notification $notification)
{
switch ($notification->getType()) {
case NotificationView::ERROR:
return 'ERROR';
case NotificationView::WARNING:
return 'WARNING';
case NotificationView::SUCCESS:
return 'SUCCESS';
default:
return 'UNKNOWN';
}
}
示例5: resolveType
protected function resolveType(Notification $notification)
{
switch ($notification->getType()) {
case FAX_NOTIFICATION_ERROR:
return 'ERROR';
case FAX_NOTIFICATION_WARNING:
return 'WARNING';
case FAX_NOTIFICATION_SUCCESS:
return 'SUCCESS';
default:
return 'UNKNOWN';
}
}
示例6: getNotificationUrl
public function getNotificationUrl(Notification $notification)
{
return $this->container->get('router')->generate('notification_show', array('slug' => $notification->getProject()->getSlug(), $notification->getType() => true));
}
示例7: configureDefault
/**
* Sets the congifuration settings of the given default notification.
*
* @param \Codenest\Ahem\Notification $notification
*
* @return \Codenest\Ahem\Notification
*/
protected function configureDefault(Notification $notification)
{
$settings = $this->config->getSettings($notification->getType());
return $notification->configure($settings);
}