本文整理汇总了PHP中thebuggenie\core\framework\Event::getSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::getSubject方法的具体用法?PHP Event::getSubject怎么用?PHP Event::getSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Event
的用法示例。
在下文中一共展示了Event::getSubject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetSubject
/**
* @covers \thebuggenie\core\framework\Event::getSubject
* @depends testCreateNew
*/
public function testGetSubject(\thebuggenie\core\framework\Event $event)
{
$this->assertEquals('subject', $event->getSubject());
}
示例2: listen_get_backdrop_partial
/**
* @Listener(module='core', identifier='get_backdrop_partial')
* @param \thebuggenie\core\framework\Event $event
*/
public function listen_get_backdrop_partial(framework\Event $event)
{
if ($event->getSubject() == 'mailing_editincomingemailaccount') {
$account = new IncomingEmailAccount(framework\Context::getRequest()->getParameter('account_id'));
$event->addToReturnList($account, 'account');
$event->setReturnValue('mailing/editincomingemailaccount');
$event->setProcessed();
}
}
示例3: listen_viewissue_panel
public function listen_viewissue_panel(framework\Event $event)
{
if (framework\Context::getModule('vcs_integration')->getSetting('vcs_mode_' . framework\Context::getCurrentProject()->getID()) == self::MODE_DISABLED) {
return;
}
$links = IssueLink::getCommitsByIssue($event->getSubject());
include_component('vcs_integration/viewissue_commits', array('links' => $links, 'projectId' => $event->getSubject()->getProject()->getID()));
}
示例4: listen_thebuggenie_core_entities_File_hasAccess
/**
* File access listener
*
* @param \thebuggenie\core\framework\Event $event
*/
public static function listen_thebuggenie_core_entities_File_hasAccess(Event $event)
{
$file = $event->getSubject();
if ($file->getID() == self::getHeaderIconID() || $file->getID() == self::getFaviconID()) {
$event->setReturnValue(true);
$event->setProcessed();
}
}
示例5: listen_thebuggenie_core_entities_File_hasAccess
public static function listen_thebuggenie_core_entities_File_hasAccess(framework\Event $event)
{
$file = $event->getSubject();
$projects = self::getB2DBTable()->getByFileID($file->getID());
foreach ($projects as $project) {
if ($project->hasAccess()) {
$event->setReturnValue(true);
$event->setProcessed();
break;
}
}
}
示例6: User__removeStarredArticle
/**
* Removes an article from the list of flagged articles
*
* @param framework\Event $event
*/
public function User__removeStarredArticle(framework\Event $event)
{
$user = $event->getSubject();
$arguments = $event->getParameters();
$article_id = $arguments[0];
UserArticles::getTable()->removeStarredArticle($user->getID(), $article_id);
if (isset($user->_starredarticles)) {
$articles = $user->_retrieve('publish', 'starredarticles');
unset($articles[$article_id]);
$user->_store('publish', 'starredarticles', $articles);
}
$event->setProcessed();
$event->setReturnValue(true);
}
示例7: listen_issueSaveLock
public function listen_issueSaveLock(framework\Event $event)
{
$this->_lockIssueAfter(framework\Context::getRequest(), $event->getSubject());
}
示例8: listen_get_backdrop_partial
/**
* @Listener(module='core', identifier='get_backdrop_partial')
* @param \thebuggenie\core\framework\Event $event
*/
public function listen_get_backdrop_partial(framework\Event $event)
{
$request = framework\Context::getRequest();
$options = array();
switch ($event->getSubject()) {
case 'agileboard':
$template_name = 'agile/editagileboard';
$board = $request['board_id'] ? entities\tables\AgileBoards::getTable()->selectById($request['board_id']) : new entities\AgileBoard();
if (!$board->getID()) {
$board->setAutogeneratedSearch(\thebuggenie\core\entities\SavedSearch::PREDEFINED_SEARCH_PROJECT_OPEN_ISSUES);
$board->setTaskIssuetype(framework\Settings::get('issuetype_task'));
$board->setEpicIssuetype(framework\Settings::get('issuetype_epic'));
$board->setIsPrivate($request->getParameter('is_private', true));
$board->setProject($request['project_id']);
}
$options['board'] = $board;
break;
case 'milestone_finish':
$template_name = 'agile/milestonefinish';
$options['project'] = \thebuggenie\core\entities\tables\Projects::getTable()->selectById($request['project_id']);
$options['board'] = entities\tables\AgileBoards::getTable()->selectById($request['board_id']);
$options['milestone'] = \thebuggenie\core\entities\tables\Milestones::getTable()->selectById($request['milestone_id']);
if (!$options['milestone']->hasReachedDate()) {
$options['milestone']->setReachedDate(time());
}
break;
case 'agilemilestone':
$template_name = 'agile/milestone';
$options['project'] = \thebuggenie\core\entities\tables\Projects::getTable()->selectById($request['project_id']);
$options['board'] = entities\tables\AgileBoards::getTable()->selectById($request['board_id']);
if ($request->hasParameter('milestone_id')) {
$options['milestone'] = \thebuggenie\core\entities\tables\Milestones::getTable()->selectById($request['milestone_id']);
}
break;
default:
return;
}
foreach ($options as $key => $value) {
$event->addToReturnList($value, $key);
}
$event->setReturnValue($template_name);
$event->setProcessed();
}
示例9: listenPublishFixtureArticleCreated
public function listenPublishFixtureArticleCreated(\thebuggenie\core\framework\Event $event)
{
$this->cliEcho($event->getParameter('imported') ? "Importing " : "Skipping ");
$this->cliEcho($event->getSubject() . "\n", 'white', 'bold');
}