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


PHP Members::add方法代码示例

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


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

示例1: generateFixtures

 /** @before */
 function generateFixtures()
 {
     $this->members = $this->membersInstance();
     $this->existingMember = A::member()->withId('abcd')->withBalance(3000)->build();
     $this->members->add(A::member()->withId('wxyz')->withBalance(1000)->build());
     $this->members->add($this->existingMember);
     $this->members->add(A::member()->withId('hijk')->build());
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:9,代码来源:MembersTest.php

示例2:

		$member['password'] = 'Not Specified';

		$member['type'] = $_REQUEST['type'];
		if($member['type'] == 'NEWTYPE') {
			if(!($_REQUEST['type2'] =='')){
				$member['type'] = $_REQUEST['type2'];
			} else {
				$member['type'] = 'N/A';
			}
		} 
		$member['login_type'] = $_REQUEST['login_type'];
        $member['category'] = $_REQUEST['category'];
		$member['barcode'] = 'Not Specified';
		$member['expired'] = 0;
		
		$mem->add($member);		
	}

	// Check member /////////////////////////////////////////////////////
	if(isset($_REQUEST['BtnCheck'])){
		$type = $_REQUEST['type'];
		$surname = $_REQUEST['surname'];
		$firstnames = $_REQUEST['firstnames'];
		$title = $_REQUEST['title'];
		$address = $_REQUEST['address'];
		$nic = $_REQUEST['nic'];
		$reg_no = $_REQUEST['reg_no'];
		$phone = $_REQUEST['phone'];
		$email = $_REQUEST['email'];
		$index_no = $_REQUEST['index_no'];
	
开发者ID:nalaka,项目名称:pusthaka1,代码行数:30,代码来源:member_add.php

示例3: myFriendHasAnAccountBalanceOfMxn

 /**
  * @Given my friend has an account balance of :amount MXN
  */
 public function myFriendHasAnAccountBalanceOfMxn($amount)
 {
     $myFriend = A::member()->withId('xyz')->withBalance($amount)->build();
     $this->members->add($myFriend);
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:8,代码来源:MemberContext.php

示例4: function

$app->post('/members', function () use($app) {
    $request = (array) json_decode($app->request->getBody());
    switch ($request['action']) {
        case 'GET':
            $action = new Members();
            $action->get((array) $request['info']);
            $insert = new Request();
            $response = $insert->query($action->sql);
            break;
        case 'REMOVE':
            break;
        case 'EDIT':
            break;
        case 'ADD':
            $action = new Members();
            $action->add((array) $request['info']);
            $insert = new Request();
            $insert->insertNR($action->sql);
            $response = $request['info'];
            break;
        default:
            # code...
            break;
    }
    // $response = $request;
    echo json_encode($response);
});
$app->error(function (Exception $exc) use($app) {
    if ($exc->getCode() !== 0) {
        $app->response->setStatus($exc->getCode());
    }
开发者ID:bobbyfisher928,项目名称:OneYum,代码行数:31,代码来源:index.php

示例5: Member

<?php

// 関連ファイルを読み込みます。
require_once 'memberclass.php';
require_once 'membersclass.php';
// ダミーの会員データを作成
$member1 = new Member(1, "姓1", "名1", "email1@example.com", "password1");
$member2 = new Member(2, "姓2", "名2", "email2@example.com", "password2");
$member3 = new Member(3, "姓3", "名3", "email3@example.com", "password3");
$member4 = new Member(4, "姓4", "名4", "email4@example.com", "password4");
$member5 = new Member(5, "姓5", "名5", "email5@example.com", "password5");
// Membersクラスに会員データを追加
$members = new Members();
$members->add($member1);
$members->add($member2);
$members->add($member3);
$members->add($member4);
$members->add($member5);
// getIteratorによりイテレータを取得
$iterator = $members->getIterator();
// ループ処理
foreach ($iterator as $member) {
    print $member->getId() . " ";
    print $member->getLastname() . " ";
    print $member->getFirstname() . " ";
    print $member->getEmail() . " ";
    print $member->getPassword() . "<br>";
}
开发者ID:miyamoto-shinji,项目名称:php_01,代码行数:28,代码来源:iterator.php

示例6: index

 public function index()
 {
     $cards = new Cards($this->db);
     $members = new Members($this->db);
     $this->f3->set('months', array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'));
     if ($this->f3->exists('POST.join')) {
         $audit = \Audit::instance();
         $this->f3->scrub($_POST);
         $this->f3->set('SESSION.flash', array());
         // validate form
         if (!preg_match("/^[\\w\\-]{2,30}\$/", $this->f3->get('POST.name'))) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid name. Only letters, numbers, underscores (_), and dashes (-) are allowed.'));
         }
         if ($members->count(array('name=?', $this->f3->get('POST.name'))) != 0) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Your name is already taken by another player. Please select a different name and try again!'));
         }
         if (!$audit->email($this->f3->get('POST.email'), FALSE)) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid email address'));
         }
         if ($members->count(array('email=?', $this->f3->get('POST.email'))) != 0) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Your email address is already in use by another player.'));
         }
         if (!$audit->url($this->f3->get('POST.url'))) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid trade post URL.'));
         }
         if (!preg_match("/^.{6,}\$/", $this->f3->get('POST.password'))) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Your password must contain at least 6 characters.'));
         }
         if ($this->f3->get('POST.password') !== $this->f3->get('POST.password2')) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Your passwords don\'t match!'));
         }
         if (!in_array($this->f3->get('POST.birthday'), $this->f3->get('months'))) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid birthday'));
         }
         if ($cards->count(array('id=?', $this->f3->get('POST.collecting'))) == 0) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid collecting deck.'));
         }
         if ($this->f3->get('POST.refer') !== '' && $members->count(array('name=?', $this->f3->get('POST.refer'))) == 0) {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Invalid referral - that player\'s name doesn\'t exist in our database. Please check your spelling and try again!'));
         }
         // honey pot
         if ($this->f3->get('POST.username') !== '') {
             $this->f3->push('SESSION.flash', array('type' => 'warning', 'msg' => 'Please do not use autofill or similar tools!'));
         }
         // process form if there are no errors
         if (count($this->f3->get('SESSION.flash')) === 0) {
             $this->f3->set('POST.status', 'Pending');
             $this->f3->set('POST.level', 1);
             $this->f3->set('POST.membercard', 'No');
             $this->f3->set('POST.mastered', 'None');
             $this->f3->set('POST.wishlist', 'Coming soon.');
             $this->f3->set('POST.biography', 'Coming soon.');
             $this->f3->set('POST.password', password_hash($this->f3->get('POST.password'), PASSWORD_DEFAULT));
             $this->f3->set('collectingID', $this->f3->get('POST.collecting'));
             $this->f3->set('POST.collecting', $cards->getById($this->f3->get('POST.collecting'))->filename);
             $mailer = new Mailer();
             $message = $mailer->message()->setSubject($this->f3->get('tcgname') . ': New Member')->setFrom(array($this->f3->get('noreplyemail') => 'MyTCG'))->setTo(array($this->f3->get('tcgemail')))->setReplyTo(array($this->f3->get('POST.email')))->setBody(Template::instance()->render('app/templates/emails/newmember.htm'), 'text/html');
             // send email & save to db
             if ($mailer->send($message) && $members->add()) {
                 $this->f3->set('sp', array());
                 // random choice cards
                 for ($i = 0; $i < $this->f3->get('num_startchoice'); $i++) {
                     $this->f3->push('sp', $cards->random(array('id=?', $this->f3->get('collectingID'))));
                 }
                 // random regular cards
                 for ($i = 0; $i < $this->f3->get('num_startreg'); $i++) {
                     $this->f3->push('sp', $cards->random(array('worth=?', 1)));
                 }
                 // random special cards
                 for ($i = 0; $i < $this->f3->get('num_startspc'); $i++) {
                     $this->f3->push('sp', $cards->random(array('worth=?', 2)));
                 }
                 $mailer = new Mailer();
                 $message = $mailer->message()->setSubject($this->f3->get('tcgname') . ': Starter Pack')->setFrom(array($this->f3->get('noreplyemail') => $this->f3->get('tcgname')))->setTo(array($this->f3->get('POST.email')))->setReplyTo(array($this->f3->get('tcgemail')))->setBody(Template::instance()->render('app/templates/emails/starterpack.htm'), 'text/html');
                 $result = $mailer->send($message);
                 // load welcome message
                 $this->f3->set('content', 'app/views/welcome.htm');
             } else {
                 $this->f3->push('SESSION.flash', array('type' => 'danger', 'msg' => 'There was a problem processing your request. Please try again or contact us for assistance!'));
             }
         }
     }
     if (!$this->f3->exists('content')) {
         $this->f3->set('content', 'app/views/join.htm');
     }
     $this->f3->set('decks', $cards->allAlpha());
     echo Template::instance()->render('app/templates/default.htm');
 }
开发者ID:Renako,项目名称:mytcg-f3,代码行数:88,代码来源:JoinController.php


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