本文整理汇总了PHP中Registration::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::create方法的具体用法?PHP Registration::create怎么用?PHP Registration::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register_no_booking
/**
* Creates a registration record without a booking.
*/
public function register_no_booking()
{
$name = Input::get('name');
$tickets = Input::get('tickets');
$validator = Validator::make(array('name' => $name, 'tickets' => $tickets), array('name' => array('required'), 'tickets' => array('required', 'integer', 'min:1')));
if ($validator->fails()) {
return Redirect::route('register')->withInput()->withErrors($validator);
}
Registration::create(array('tickets' => $tickets, 'name' => $name));
return Redirect::route('register')->with('info', 'Registration complete!');
}
示例2: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
// $this->call('UserTableSeeder');
DB::table('bookings')->delete();
DB::table('registrations')->delete();
// Church bookings
Booking::create(array('first' => 'Spencer', 'last' => 'Kaur', 'tickets' => 1, 'source' => 'Church', 'numbers' => '1'));
Booking::create(array('first' => 'Molly', 'last' => 'Sharpe', 'tickets' => 2, 'source' => 'Church', 'numbers' => '2,3'));
Booking::create(array('first' => 'Zara', 'last' => 'Sharp', 'tickets' => 4, 'source' => 'Church', 'numbers' => '32,34,36,38'));
Booking::create(array('first' => 'Archie', 'last' => 'Field', 'tickets' => 8, 'source' => 'Church', 'numbers' => '32,33,34,35,36,37,38,39'));
Booking::create(array('first' => 'Charles', 'last' => 'Dennis', 'tickets' => 12, 'source' => 'Church', 'numbers' => '132,133,134,135,136,137,138,139,140,141,142'));
Booking::create(array('first' => 'Jack', 'last' => 'Ryan', 'tickets' => 1, 'source' => 'Church', 'numbers' => '501'));
Booking::create(array('first' => 'Charlotte', 'last' => 'Crawford', 'tickets' => 2, 'source' => 'Church', 'numbers' => '503,504'));
Booking::create(array('first' => 'Rebecca', 'last' => 'Atkinson', 'tickets' => 2, 'source' => 'Church', 'numbers' => '505,506'));
Booking::create(array('first' => 'Lara', 'last' => 'Douglas', 'tickets' => 2, 'source' => 'Church', 'numbers' => '602,605'));
Booking::create(array('first' => 'Harriet', 'last' => 'Tucker', 'tickets' => 1, 'source' => 'Church'));
Booking::create(array('first' => 'Lilly', 'last' => 'Charlton', 'tickets' => 1, 'source' => 'Church'));
Booking::create(array('first' => 'Logan', 'last' => 'Clements', 'tickets' => 2, 'source' => 'Church'));
$booking = Booking::create(array('first' => 'Evie', 'last' => 'Pritchard', 'tickets' => 1, 'source' => 'Church'));
$booking->registrations()->save(new Registration(array('tickets' => 2)));
$booking = Booking::create(array('first' => 'Lara', 'last' => 'Armstrong', 'tickets' => 2, 'source' => 'Church'));
$booking->registrations()->save(new Registration(array('tickets' => 2)));
$booking = Booking::create(array('first' => 'Charlie', 'last' => 'Slater', 'tickets' => 6, 'source' => 'Church'));
$booking->registrations()->save(new Registration(array('tickets' => 2)));
$booking = Booking::create(array('first' => 'Rachel', 'last' => 'Whittaker', 'tickets' => 1, 'source' => 'Church'));
$booking->registrations()->save(new Registration(array('tickets' => 1)));
// EventBrite bookings
Booking::create(array('first' => 'Lauren', 'last' => 'Conway', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Emily', 'last' => 'Henderson', 'tickets' => 2, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Sienna', 'last' => 'Yates', 'tickets' => 3, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Harrison', 'last' => 'Carroll', 'tickets' => 4, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Taylor', 'last' => 'Palmer', 'tickets' => 8, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Maya', 'last' => 'Marsh', 'tickets' => 10, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Riley', 'last' => 'Farmer', 'tickets' => 7, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Amelia', 'last' => 'Ashton', 'tickets' => 2, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Jonathan', 'last' => 'Riley', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Anthony', 'last' => 'Moss', 'tickets' => 2, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Ellie', 'last' => 'Henry', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Sofia', 'last' => 'Phillips', 'tickets' => 2, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Owen', 'last' => 'Bartlett', 'tickets' => 2, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Alicia', 'last' => 'Jordan', 'tickets' => 4, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Peter', 'last' => 'Hancock', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Aidan', 'last' => 'Walker', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Jennifer', 'last' => 'Sinclair', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Georgina', 'last' => 'Henry', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Jonathan', 'last' => 'Barber', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Francesca', 'last' => 'Rice', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Scott', 'last' => 'Rowe', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Nathan', 'last' => 'Gould', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Harley', 'last' => 'May', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Brandon', 'last' => 'Riley', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Brandon', 'last' => 'Richardson', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Adam', 'last' => 'Little', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Matthew', 'last' => 'Duncan', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Daisy', 'last' => 'Wall', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Louis', 'last' => 'Potts', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Amelie', 'last' => 'Bentley', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Harriet', 'last' => 'Cameron', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Jude', 'last' => 'Fraser', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Aidan', 'last' => 'Farmer', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Rebecca', 'last' => 'Wallace', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Lucas', 'last' => 'Kaur', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Faith', 'last' => 'Bartlett', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Luke', 'last' => 'Cooke', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Lilly', 'last' => 'Farrell', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Peter', 'last' => 'Boyle', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'James', 'last' => 'Kay', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Nicholas', 'last' => 'Morley', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Mason', 'last' => 'Kent', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Sofia', 'last' => 'Freeman', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Isobel', 'last' => 'Watts', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Andrew', 'last' => 'Garner', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Henry', 'last' => 'Farmer', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Louie', 'last' => 'Fowler', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Amy', 'last' => 'Doyle', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Rhys', 'last' => 'Buckley', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Bradley', 'last' => 'Warren', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Sean', 'last' => 'Dennis', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Muhammad', 'last' => 'Murphy', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Nicole', 'last' => 'Robertson', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Aidan', 'last' => 'Hicks', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Abigail', 'last' => 'Page', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Kieran', 'last' => 'Swift', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Isobel', 'last' => 'Austin', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Jake', 'last' => 'Bradley', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Yasmin', 'last' => 'Davey', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Alice', 'last' => 'Shepherd', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Taylor', 'last' => 'Bradshaw', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Kian', 'last' => 'Payne', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Sienna', 'last' => 'Wilkins', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Eleanor', 'last' => 'Collier', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Bradley', 'last' => 'Griffiths', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Jay', 'last' => 'Black', 'tickets' => 1, 'source' => 'EventBrite'));
Booking::create(array('first' => 'Rachel', 'last' => 'Duncan', 'tickets' => 1, 'source' => 'EventBrite'));
//.........这里部分代码省略.........
示例3: store_registrations
public function store_registrations()
{
if ($this->isPostRequest()) {
$input_data = Input::all();
// input all data
$model = new Registration();
//save data into
if ($model->validate($input_data)) {
DB::beginTransaction();
try {
$model->create($input_data);
DB::commit();
Session::flash('message', 'Successfully Registered ! We will call you back soon.');
} catch (Exception $e) {
//If there are any exceptions, rollback the transaction`
DB::rollback();
Session::flash('danger', 'Failed !');
}
}
} else {
Session::flash('danger', 'Invalid Request !');
}
return Redirect::back();
}
示例4: save
/**
* Updates an existing Member's profile.
*/
public function save(array $data, Form $form)
{
$member = Member::currentUser();
$siteConfig = SiteConfig::current_site_config();
$registration = $this->getRegistration($member->ID);
if (!$registration) {
$registration = Registration::create();
}
$groupIds = $this->getSettableGroupIdsFrom($form, $member);
$member->Groups()->setByIDList($groupIds);
$form->saveInto($member);
$form->saveInto($registration);
$registration->MemberID = $member->ID;
$registration->ParentID = $siteConfig->CurrentEventID;
try {
$member->write();
} catch (ValidationException $e) {
$form->sessionMessage($e->getResult()->message(), 'bad');
return $this->redirectBack();
}
try {
$registration->write();
} catch (ValidationException $e) {
$form->sessionMessage($e->getResult()->message(), 'bad');
return $this->redirectBack();
}
$form->sessionMessage('Your details have been updated.', 'good');
return $this->redirectBack();
}
示例5: createRegistration
/**
* Create a new registration for an event
*
* @param integer $numTickets
* Number of tickets required (must be an integer between 1 and 10).
* @return Registration
* Response body containing the new registration
*/
public function createRegistration($numTickets = 1)
{
$registration = new Registration($this->client, ['tickets' => $numTickets], $this);
$this->registrations[] = $registration;
$registration->create();
return $registration;
}