本文整理汇总了PHP中Event类的典型用法代码示例。如果您正苦于以下问题:PHP Event类的具体用法?PHP Event怎么用?PHP Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Event类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _ops_delete
function _ops_delete($OID = 0, $CID = 0)
{
$OID = max(0, intval($OID));
$CID = max(0, intval($CID));
$msg = '';
loginRequireMgmt();
if (!loginCheckPermission(USER::TEST_EVENT)) {
redirect("errors/401");
}
$itemName = "Event";
$urlPrefix = "test_event";
$object = new Event($OID, $CID);
if (!$object->exists()) {
$msg = "{$itemName} not found!";
} else {
transactionBegin();
if ($object->delete()) {
transactionCommit();
$msg = "{$itemName} deleted!";
} else {
TransactionRollback();
$msg = "{$itemName} delete failed!";
}
}
redirect("{$urlPrefix}/manage", $msg);
}
开发者ID:brata-hsdc,项目名称:brata.masterserver,代码行数:26,代码来源:ops_delete.php
示例2: enforceOwnerSecurity
public function enforceOwnerSecurity(Event $event)
{
$user = $this->getUser();
if ($user != $event->getOwner()) {
throw $this->createAccessDeniedException('You are not the owner!!!');
}
}
开发者ID:yujunjie0603,项目名称:symfony_projet2,代码行数:7,代码来源:Controller.php
示例3: errorItemNotFound
public function errorItemNotFound($error)
{
$evt = new \Event();
if ($this->_me) {
$evt->runEvent('myvcardinvalid');
}
}
开发者ID:Hywan,项目名称:moxl,代码行数:7,代码来源:Get.php
示例4: _edit
function _edit($OID = 0, $CID = 0)
{
loginRequireMgmt();
if (!loginCheckPermission(USER::TEST_EVENT)) {
redirect("errors/401");
}
$item = "Event";
$urlPrefix = "test_event";
$object = new Event();
$object->retrieve($OID, $CID);
if (!$object->exists()) {
$data['body'][] = "<p>{$item} Not Found!</p>";
} else {
$fdata['form_heading'] = "Edit {$item}";
$fdata['object'] = $object;
$fdata['actionUrl'] = myUrl("{$urlPrefix}/ops_update");
$fdata['actionLabel'] = "Submit";
$fdata['cancelUrl'] = myUrl("{$urlPrefix}/manage");
$fdata['cancelLabel'] = "Cancel";
$form = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form.php", $fdata);
$data['head'][] = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form_js.php");
$data['body'][] = "<h2>Edit {$item}</h2>";
$data['body'][] = $form;
}
View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
开发者ID:brata-hsdc,项目名称:brata.masterserver,代码行数:26,代码来源:edit.php
示例5: createEvent
protected function createEvent()
{
$event = new Event();
$event->setTitle('Test Event #1');
$event->setStartDate('2010-06-01');
return $event;
}
开发者ID:netcarver,项目名称:flourish,代码行数:7,代码来源:fORMColumnTest.php
示例6: redirectRole
function redirectRole()
{
$userName = $this->input->post('userName');
$password = $this->input->post('password');
$this->load->model('user');
$user = new user();
$results = $user->searchUserByUsename($userName);
if ($results[0]->userid == 1) {
$this->load->model('Vacancy');
$vacancy = new Vacancy();
$array = $vacancy->getVacancyByUser($results[0]->userid);
$data["vacancies"] = $array;
$this->load->view('mainView', $data);
} else {
if ($results[0]->userid == 2) {
$this->load->model('Vacancy');
$vacancy = new Vacancy();
$array = $vacancy->getVacancyByUser($results[0]->userid);
$data["vacancies"] = $array;
$this->load->view('employerView', $data);
} else {
if ($results[0]->userid == 3) {
$this->load->model('Event');
$event = new Event();
$array = $event->getAllEventByUser($results[0]->userid);
$data["events"] = $array;
$this->load->view('organizerview', $data);
}
}
}
}
开发者ID:chamithanara,项目名称:hoyanna.lk-1,代码行数:31,代码来源:Role_Controller.php
示例7: generateCoworkerInvitationList
/**
* A custom method within the Plugin to generate the content
*
* @return string : HTML form
* @see class/UserRelations.class.php
*/
function generateCoworkerInvitationList()
{
$output = '';
$_SESSION['do_coworker']->getAllRequestsSent();
if ($_SESSION['do_coworker']->getNumrows()) {
$count = 0;
while ($_SESSION['do_coworker']->next()) {
$e_remove_invitation = new Event("do_coworker->eventRemoveInvitation");
$e_remove_invitation->addParam('id', $_SESSION['do_coworker']->iduser_relations);
$e_remove_invitation->addParam("goto", $_SERVER['PHP_SELF']);
$output .= '<div class="co_worker_item"><div class="co_worker_desc">';
$output .= '<div id="invite' . $count . '" class="co_worker_item co_worker_desc">';
$output .= '<div style="position: relative;">';
if ($_SESSION['do_coworker']->idcoworker) {
$output .= $_SESSION['do_User']->getFullName($_SESSION['do_coworker']->idcoworker);
} else {
$output .= $_SESSION['do_coworker']->decrypt($_SESSION['do_coworker']->enc_email);
}
$img_del = '<img src="/images/delete.gif" width="14px" height="14px" alt="" />';
$output .= '<div width="15px" id="trashcan' . $count . '" class="deletenote" style="right:0;">' . $e_remove_invitation->getLink($img_del) . '</div>';
$output .= '</div></div>';
$output .= '</div></div>';
}
return $output;
} else {
$this->setIsActive(false);
}
}
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:34,代码来源:CoworkerListInvitations.class.php
示例8: actionAddEvent
public function actionAddEvent()
{
$data = $_POST;
$model = new Event();
$model->u_id = $data['uid'];
$model->lat = $data['lat'];
$model->lng = $data['lng'];
$model->address = $data['address'];
$model->message = $data['message'];
$model->status = 0;
if ($model->save()) {
$e_id = $model->primaryKey;
$model = new EventMedia();
foreach (explode(",", $data['files'], -1) as $id) {
$model->updateByPk($id, array("e_id" => $e_id));
}
$tids = explode(",", $data['tid']);
foreach ($tids as $tid) {
$model = new EventType();
$model->event = $e_id;
$model->node = $tid;
$model->save();
}
echo 1;
} else {
echo 0;
}
}
开发者ID:snipesn,项目名称:UkrYama-2,代码行数:28,代码来源:EventController.php
示例9: handle
public function handle($stanza, $parent = false)
{
$jid = explode('/', (string) $stanza->attributes()->from);
$to = current(explode('/', (string) $stanza->attributes()->to));
$evt = new \Event();
if ($stanza->composing) {
$evt->runEvent('composing', array($jid[0], $to));
}
if ($stanza->paused) {
$evt->runEvent('paused', array($jid[0], $to));
}
if ($stanza->gone) {
$evt->runEvent('gone', array($jid[0], $to));
}
if ($stanza->body || $stanza->subject) {
$m = new \modl\Message();
$m->set($stanza, $parent);
if ($stanza->request) {
$from = (string) $stanza->attributes()->from;
$id = (string) $stanza->attributes()->id;
\Moxl\Stanza\Message::receipt($from, $id);
}
if (!preg_match('#^\\?OTR#', $m->body)) {
$md = new \modl\MessageDAO();
$md->set($m);
$this->pack($m);
$this->deliver();
}
// Can we remove this ?
/*if($m->type == 'groupchat' && $m->subject != '') {
$evt->runEvent('subject', $m);
}*/
}
}
开发者ID:Hywan,项目名称:moxl,代码行数:34,代码来源:Message.php
示例10: validate_event_form
public static function validate_event_form($event_id, $event_title, $event_title, $event_content, $event_image, $event_date, $event_cat_id, $event_user_id, $event_venue, $event_time_stamp, $event_address_1, $event_address_2, $event_state, $event_city, $event_zip)
{
$create_event_ok = 'N';
if (isset($_POST['submit'])) {
if (empty($event_title)) {
echo 'Event Name field must not be empty, please enter a name for your event';
} else {
$create_event_ok = 'Y';
}
if (empty($event_date)) {
echo 'Please set a date for your event';
} else {
$create_event_ok = 'Y';
}
if (empty($event_venue)) {
echo 'Please enter a venue for your event';
} else {
$create_event_ok = 'Y';
}
if ($create_event_ok == 'Y') {
$event = new Event();
$event->create_event($event_id, $event_title, $event_title, $event_content, $event_image, $event_date, $event_cat_id, $event_user_id, $event_venue, $event_time_stamp, $event_address_1, $event_address_2, $event_state, $event_city, $event_zip);
}
} else {
echo 'Enter event info';
}
}
开发者ID:stephenx99,项目名称:xframe,代码行数:27,代码来源:Event.php
示例11: on
/**
* @return null
*/
public function on($name, $handler)
{
$event = new Event();
$event->setName($name);
$event->setHandler($handler);
$this->addEvent($event);
}
开发者ID:wispira,项目名称:framework,代码行数:10,代码来源:Manager.php
示例12: _trigger
/**
* Invoke a trigger
*
* @param Event $event The event that is triggered
* @param boolean $return_when_processed (optional) whether to return when processed or continue
*
* @return mixed
*/
protected static function _trigger(Event $event, $return_when_processed = false)
{
$module = $event->getModule();
$identifier = $event->getIdentifier();
Logging::log("Triggering {$module} - {$identifier}");
if (isset(self::$_registeredlisteners[$module][$identifier])) {
foreach (self::$_registeredlisteners[$module][$identifier] as $trigger) {
try {
$cb_string = is_array($trigger) ? get_class($trigger[0]) . '::' . $trigger[1] : $trigger;
if (is_object($cb_string)) {
Logging::log('Running anonymous callback function');
} else {
Logging::log('Running callback function ' . $cb_string);
}
$retval = call_user_func($trigger, $event);
if ($return_when_processed && $event->isProcessed()) {
return true;
}
if (is_object($cb_string)) {
Logging::log('done (Running anonymous callback function)');
} else {
Logging::log('done (Running callback function ' . $cb_string . ')');
}
} catch (\Exception $e) {
throw $e;
}
}
}
Logging::log("done (Triggering {$module} - {$identifier})");
}
开发者ID:founderio,项目名称:thebuggenie,代码行数:38,代码来源:Event.php
示例13: getEvent
/**
* Get an Event with the given path
* @param string $path
* @return Event
*/
protected function getEvent($path, $id)
{
$event = new Event($this->factory, $this->getNodeTypeManager());
$event->setPath($path);
$event->setIdentifier($id);
return $event;
}
开发者ID:frogriotcom,项目名称:jackalope,代码行数:12,代码来源:EventFilterIdentifiersTest.php
示例14: setup_edit
function setup_edit()
{
$dao = getEventDAO();
$e = new Event();
$e->setFromRequest();
$dao->getEvents($e, Q_ALL, true);
if ($e->numResults > 0) {
$per = $e->results[0]->person;
} else {
$per = new PersonDetail();
$per->setFromRequest();
$e->results = array(new Event());
$e->results[0]->type = -1;
}
$per->queryType = Q_IND;
$dao = getPeopleDAO();
$dao->getPersonDetails($per);
if ($per->numResults > 0) {
$ret = $per->results[0];
} else {
$ret = $per;
}
$ret->events = $e->results;
return $ret;
}
开发者ID:redbugz,项目名称:rootstech2013,代码行数:25,代码来源:editForm.php
示例15: createMailMessage
private function createMailMessage($name, $email, $message, $transferInfo)
{
$event = new Event();
$curEvent = $event->getEventById($transferInfo['event_id']);
$offer = strcmp($transferInfo['mode'], "offer") == 0 ? true : false;
$buffer;
$buffer = "Hallo,\n";
$buffer .= "Sie haben eine Antwort auf Ihr ";
if ($offer) {
$buffer .= "Mitfahrangebot ";
} else {
$buffer .= "Mitfahrgesuch ";
}
$buffer .= "erhalten.\n\n";
$buffer .= "Es handelt sich um eine Fahrt zu dieser Veranstaltung:\n";
$buffer .= "Titel: " . $curEvent['title'] . "\n";
$buffer .= "Datum: " . date("d.m.Y", strtotime($curEvent['ev_date'])) . "\n";
$buffer .= "Start: " . $transferInfo['start'] . "\n";
$buffer .= "Ziel: " . $transferInfo['destination'] . "\n\n";
$buffer .= "Diese Nachricht wurde fuer Sie eingegeben:\n";
$buffer .= "Nachricht von: " . $name . "\n";
$buffer .= "E-Mail: " . $email . "\n";
$buffer .= "Nachricht: " . $message . "\n\n";
$buffer .= "Um sich mit dem Interessenten per Mail in Verbindung zu setzten, koennen Sie auf \"Antwort\" in Ihrem Mailprogramm klicken oder die unter \"E-Mail:\" - genannte Mailadresse nutzen.\n\n";
$buffer .= "Gute Reise und viel Freude bei der Veranstaltung wuenscht Ihnen\nDhamma-Reise/Ralf Rapude\n\n";
return $buffer;
}
开发者ID:rapude,项目名称:dhamma-reise,代码行数:27,代码来源:Mailer.class.php
示例16: getEventName
/**
* @param string|Event $event
* @return string
*/
protected function getEventName($event)
{
if ($event instanceof Event) {
return $event->getName();
}
return $event;
}
开发者ID:lytc,项目名称:sloths,代码行数:11,代码来源:ObserverTrait.php
示例17: testAddGroupsToTheMix
public function testAddGroupsToTheMix()
{
$form = new Event();
$form->setData(['subject' => 'subject1', 'event_date' => '2014-01-01', 'event_time' => '13:00', 'event_end' => '13:01']);
$form->bind(new \ArrayObject(['groups' => [(object) ['id' => 1, 'name_short' => '01']]]));
$this->assertTrue($form->isValid(), print_r($form->getMessages(), true));
}
开发者ID:bix0r,项目名称:Stjornvisi,代码行数:7,代码来源:TestEvent.php
示例18: handle
public function handle($stanza, $parent = false)
{
$message = $stanza->forwarded->message;
$jid = explode('/', (string) $message->attributes()->from);
$to = current(explode('/', (string) $message->attributes()->to));
$evt = new \Event();
if ($message->composing) {
$evt->runEvent('composing', array($jid[0], $to));
}
if ($message->paused) {
$evt->runEvent('paused', array($jid[0], $to));
}
if ($message->gone) {
$evt->runEvent('gone', array($jid[0], $to));
}
if ($message->body || $message->subject) {
$m = new \modl\Message();
$m->set($message, $stanza->forwarded);
if (!preg_match('#^\\?OTR#', $m->body)) {
$md = new \modl\MessageDAO();
$md->set($m);
$this->pack($m);
$this->deliver();
}
}
}
开发者ID:Hywan,项目名称:moxl,代码行数:26,代码来源:Carbons.php
示例19: triggerEvent
private function triggerEvent(DOMNode $node, Event $event, array $triggeredNodes = array())
{
$hash = spl_object_hash($node);
if (isset(self::$eventHandlers[$hash][$event->getType()])) {
foreach (self::$eventHandlers[$hash][$event->getType()] as $handlerData) {
$handler = $handlerData['handler'];
$selector = $handlerData['selector'];
if ($selector === null) {
$boundHandler = $handler->bindTo($node);
$boundHandler($event);
// Delegated handler
} else {
foreach ($triggeredNodes as $triggeredNode) {
$matches = $this->matchesSelector($triggeredNode, $selector);
if ($matches) {
$boundHandler = $handler->bindTo($triggeredNode);
$boundHandler($event);
if ($event->isPropagationStopped()) {
return;
}
}
}
}
}
}
if ($node->parentNode && !$event->isPropagationStopped()) {
$triggeredNodes[] = $node;
$this->triggerEvent($node->parentNode, $event, $triggeredNodes);
}
}
开发者ID:asadlive84,项目名称:uniter-jquery,代码行数:30,代码来源:DomEventExtension.php
示例20: apply
public function apply(Event $event)
{
$method = 'apply' . $event->getName();
if (method_exists($this, $method)) {
$this->{$method}($event);
}
}
开发者ID:cocoders,项目名称:event-store,代码行数:7,代码来源:AggregateRootBehavior.php
注:本文中的Event类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论