当前位置: 首页>>代码示例>>PHP>>正文


PHP Participant::create方法代码示例

本文整理汇总了PHP中Participant::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Participant::create方法的具体用法?PHP Participant::create怎么用?PHP Participant::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Participant的用法示例。


在下文中一共展示了Participant::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createParticipant

 /**
  * Simple function to create a participant associated with this registration
  *
  * @param mixed $data
  *
  * @return Participant
  */
 public function createParticipant($data)
 {
     $participant = new Participant($this->client, $data, $this->event, $this);
     $this->participants[] = $participant;
     $participant->create();
     return $participant;
 }
开发者ID:dgcollard,项目名称:cruk-event-sdk,代码行数:14,代码来源:Registration.php

示例2: testcheckDuplicate

 /**
  * CheckDuplicate() method ( Checking for Duplicate Participant returns array of participant id)
  */
 public function testcheckDuplicate()
 {
     $duplicate = array();
     //Creating 3 new participants
     for ($i = 0; $i < 3; $i++) {
         $partiId[] = Participant::create($this->_contactId, $this->_eventId);
     }
     $params = array('event_id' => $this->_eventId, 'contact_id' => $this->_contactId);
     $checkDuplicate = CRM_Event_BAO_Participant::checkDuplicate($params, $duplicate);
     $this->assertEquals(count($duplicate), 3, 'Equating the array contains with duplicate array.');
     //Checking for the duplicate participant
     foreach ($duplicate as $key => $value) {
         $this->assertEquals($partiId[$key], $duplicate[$key], 'Equating the contactid which is in the database.');
     }
     //Deleting all participant
     for ($i = 0; $i < 3; $i++) {
         $partidel[] = Participant::delete($partiId[$i]);
     }
     Contact::delete($this->_contactId);
     Event::delete($this->_eventId);
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:24,代码来源:ParticipantTest.php

示例3: createParticipant

 public function createParticipant($testKey, $variantKey, $metadata = null)
 {
     $participant = Participant::create(array('testkey' => $testKey, 'variantkey' => $variantKey, 'metadata' => json_encode($metadata)));
     return $participant->id;
 }
开发者ID:lwc,项目名称:kumite-pheasant,代码行数:5,代码来源:StorageAdapter.php

示例4: Database

 session_start();
 // get database connection
 $database = new Database();
 $db = $database->getConnection();
 $tourney_id = $_POST['tourney_id'];
 //echo $tourney_id;
 // prepare participant object
 $participant = new Participant($db);
 // get user data from session
 $participant->name = "bzz86";
 //that will be username from session
 $participant->type = 1;
 //type = "Player"
 if (!$participant->checkExist()) {
     //create participant
     if ($participant->create()) {
         //registration
         if ($participant->assignToTourney($tourney_id)) {
             $_SESSION["successmsg"] = "You've been registered successfully!";
         } else {
             $_SESSION["errormsg"] = "Problems with registration";
         }
     } else {
         $_SESSION["errormsg"] = "Problems with participant creation";
     }
 } else {
     //exists in database, only register to tounament
     //registration
     if ($participant->assignToTourney($tourney_id)) {
         $_SESSION["successmsg"] = "You've been registered successfully!";
     } else {
开发者ID:bzz86,项目名称:tourney,代码行数:31,代码来源:register.php


注:本文中的Participant::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。