本文整理汇总了PHP中Stat::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Stat::find方法的具体用法?PHP Stat::find怎么用?PHP Stat::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stat
的用法示例。
在下文中一共展示了Stat::find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_run_maxHpIsThere
function test_run_maxHpIsThere()
{
Initial::addData();
$character = Finalize::run();
$id = $character->getStatId();
$stat = Stat::find($id);
$max_hp = $stat->getMaxHp();
$result = 11;
$this->assertEquals($max_hp, $result);
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$input = Input::all();
$validation = Validator::make($input, Former::$rules);
if ($validation->passes()) {
$this->former->create($input);
$data = 'lead in ';
$url = 'http://eleads.lafilm.com:8088/Cmc.Integration.LeadImport.HttpPost/ImportLeadProcessor.aspx';
if ($input['program'] == 'BSEB-O' || $input['program'] == 'BSDC-O') {
$camp = 'MAIN2';
} else {
$camp = 'MAIN';
}
$post = '';
$post .= 'Leadsource=' . $input['leadSource'];
$post .= '&Format=' . $input['format'];
$post .= '&FirstName=' . $input['FirstName'];
$post .= '&LastName=' . $input['LastName'];
$post .= '&Program=' . $input['program'];
$post .= '&Email=' . $input['email'];
$post .= '&PostalCodeorZip=' . $input['PostalCodeorZip'];
$post .= '&Phone=' . $input['Phone'];
$post .= '&Country=' . $input['Country'];
$post .= '&PreviousEducation=' . $input['PreviousEducation'];
$post .= '&leadtype=NEWLEAD&campus=' . $camp;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$stat = Input::get('stat_id');
$stats = Stat::find($stat);
$stats->convert = 1;
$stats->save();
return json_encode(array('msg' => 'Lead Processed', 'res' => $response));
}
return 'not true';
}
示例3: testFind
function testFind()
{
//Arrange
$str = 2;
$dex = 2;
$con = 2;
$intel = 2;
$wis = 2;
$cha = 2;
$init = 2;
$max_hp = 2;
$speed = 2;
$ac = 2;
$acrobatics = 2;
$arcana = 2;
$animal_handling = 2;
$athletics = 2;
$deception = 2;
$history = 2;
$insight = 2;
$intimidation = 2;
$investigation = 2;
$medicine = 2;
$nature = 2;
$perception = 2;
$performance = 2;
$persuasion = 2;
$proficiency = 2;
$religion = 2;
$sleight_of_hand = 2;
$stealth = 2;
$survival = 2;
$test_stat = new Stat($ac, $acrobatics, $animal_handling, $arcana, $athletics, $cha, $con, $deception, $dex, $history, $init, $insight, $intel, $intimidation, $investigation, $max_hp, $medicine, $nature, $perception, $performance, $persuasion, $proficiency, $religion, $speed, $sleight_of_hand, $stealth, $str, $survival, $wis);
$test_stat->save();
$str2 = 2;
$dex2 = 2;
$con2 = 2;
$int2 = 2;
$wis2 = 2;
$cha2 = 2;
$init2 = 2;
$max_hp2 = 2;
$speed2 = 2;
$ac2 = 2;
$acrobatics2 = 2;
$arcana2 = 2;
$animal_handling2 = 2;
$athletics2 = 2;
$deception2 = 2;
$history2 = 2;
$insight2 = 2;
$intimidation2 = 2;
$investigation2 = 2;
$medicine2 = 2;
$nature2 = 2;
$perception2 = 2;
$performance2 = 2;
$persuasion2 = 2;
$proficiency2 = 2;
$religion2 = 2;
$sleight_of_hand2 = 2;
$stealth2 = 2;
$survival2 = 2;
$test_stat2 = new Stat($ac2, $acrobatics2, $animal_handling2, $arcana2, $athletics2, $cha2, $con2, $deception2, $dex2, $history2, $init2, $insight2, $int2, $intimidation2, $investigation2, $max_hp2, $medicine2, $nature2, $perception2, $performance2, $persuasion2, $proficiency2, $religion2, $speed2, $sleight_of_hand2, $stealth2, $str2, $survival2, $wis2);
$test_stat2->save();
//Act
$result = Stat::find($test_stat->getId());
//Assert
$this->assertEquals($test_stat, $result);
}
示例4: getSurvival
function getSurvival()
{
$id = $this->getStatId();
$stat = Stat::find($id);
$stat_total = $stat->getSurvival();
return $stat_total;
}
示例5: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$this->stat->find($id)->delete();
return Redirect::route('stats.index');
}