本文整理汇总了PHP中Summit::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Summit::get方法的具体用法?PHP Summit::get怎么用?PHP Summit::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Summit
的用法示例。
在下文中一共展示了Summit::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* @return void
*/
public function run()
{
try {
$batch_size = 100;
$init_time = time();
$summit = null;
if (isset($_GET['batch_size'])) {
$batch_size = intval(trim(Convert::raw2sql($_GET['batch_size'])));
echo sprintf('batch_size set to %s', $batch_size) . PHP_EOL;
}
if (isset($_GET['summit_id'])) {
$summit = Summit::get()->byID(intval($_GET['summit_id']));
}
if (is_null($summit)) {
throw new Exception('summit_id is not valid!');
}
$manager = Injector::inst()->get('SpeakerSecondBreakoutAnnouncementSenderManager');
if (!$manager instanceof ISpeakerSecondBreakoutAnnouncementSenderManager) {
return;
}
$processed = $manager->send($summit, $batch_size);
$finish_time = time() - $init_time;
echo 'processed records ' . $processed . ' - time elapsed : ' . $finish_time . ' seconds.';
} catch (Exception $ex) {
SS_Log::log($ex->getMessage(), SS_Log::ERR);
}
}
示例2: handleAddDefaultEventTypes
public function handleAddDefaultEventTypes($grid, $request, $data = null)
{
$summit_id = intval($request->param('ID'));
if ($summit_id > 0 && ($summit = Summit::get()->byID($summit_id))) {
Summit::seedBasicEventTypes($summit_id);
}
}
示例3: handleDeleteAllSummitEntityEventsAction
public function handleDeleteAllSummitEntityEventsAction($gridField, $request)
{
$summit_id = intval($request->param("ID"));
$controller = $gridField->getForm()->Controller();
$this->gridField = $gridField;
$summit = Summit::get()->byID($summit_id);
$status = 404;
if (!is_null($summit)) {
$status = 200;
DB::query("DELETE FROM SummitEntityEvent WHERE SummitID = {$summit_id} ;");
}
$response = new SS_HTTPResponse();
$response->setStatusCode($status);
return $response;
}
示例4: run
/**
* Implement this method in the task subclass to
* execute via the TaskRunner
*/
public function run($request)
{
set_time_limit(0);
$summit_id = intval($request->getVar('summit_id'));
if (empty($summit_id)) {
throw new InvalidArgumentException('missing summit_id param!');
}
$summit_external_id = intval($request->getVar('summit_external_id'));
if (empty($summit_external_id)) {
throw new InvalidArgumentException('missing summit_external_id param!');
}
// get ticket types ...
$summit = Summit::get()->byID($summit_id);
if (is_null($summit)) {
throw new InvalidArgumentException("non existent summit!");
}
$summit->ExternalEventId = $summit_external_id;
$summit->write();
Summit::seedBasicEventTypes($summit_id);
Summit::seedSummitTypes($summit_id);
$client = new GuzzleHttp\Client();
$query = array('token' => EVENTBRITE_PERSONAL_OAUTH2_TOKEN);
$response = $client->get(sprintf("https://www.eventbriteapi.com/v3/events/%s/ticket_classes/", $summit_external_id), array('query' => $query));
if ($response->getStatusCode() !== 200) {
throw new Exception('invalid status code!');
}
$content_type = $response->getHeader('content-type');
if (empty($content_type)) {
throw new Exception('invalid content type!');
}
if ($content_type !== 'application/json') {
throw new Exception('invalid content type!');
}
$json = $response->getBody()->getContents();
$ticket_types = json_decode($json, true);
$ticket_types = $ticket_types['ticket_classes'];
foreach ($ticket_types as $t) {
$new_ticket = new SummitTicketType();
$new_ticket->ExternalId = $t["id"];
if (SummitTicketType::get()->filter(array('SummitID' => $summit_id, 'ExternalId' => $new_ticket->ExternalId))->count() > 0) {
continue;
}
$new_ticket->Name = $t["name"];
$new_ticket->Description = $t["description"];
$new_ticket->SummitID = $summit_id;
$new_ticket->write();
}
}
示例5: toSQL
/**
* @return string[]
*/
public function toSQL()
{
$primary_id = $this->primary_id;
$dupe_id = $this->dupe_id;
$primary = Member::get()->byID($primary_id);
$dupe = Member::get()->byID($dupe_id);
$queries = array();
$summits = Summit::get();
foreach ($summits as $summit) {
if ($dupe->isAttendee($summit->ID) && !$primary->isAttendee($summit->ID)) {
// move
array_push($queries, "UPDATE SummitAttendee SET MemberID = {$primary_id} WHERE MemberID = {$dupe_id} AND SummitID = {$summit->ID};");
}
}
return $queries;
}
示例6: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$summits = Summit::get();
$SummitDropDownField = new DropdownField("SummitID", "Summit", $summits->map("ID", "Name"));
$fields->addFieldToTab('Root.Main', $SummitDropDownField);
//google analitycs tracking params
$fields->addFieldToTab("Root.GoogleAnalitycs", new TextField("GAConversionId", "Conversion Id", "994798451"));
$fields->addFieldToTab("Root.GoogleAnalitycs", new TextField("GAConversionLanguage", "Conversion Language", "en"));
$fields->addFieldToTab("Root.GoogleAnalitycs", new TextField("GAConversionFormat", "Conversion Format", "3"));
$fields->addFieldToTab("Root.GoogleAnalitycs", new ColorField("GAConversionColor", "Conversion Color", "ffffff"));
$fields->addFieldToTab("Root.GoogleAnalitycs", new TextField("GAConversionLabel", "Conversion Label", "IuM5CK3OzQYQ89at2gM"));
$fields->addFieldToTab("Root.GoogleAnalitycs", new TextField("GAConversionValue", "Conversion Value", "0"));
$fields->addFieldToTab("Root.GoogleAnalitycs", new CheckboxField("GARemarketingOnly", "Remarketing Only"));
return $fields;
}
示例7: handleSummit
/**
* @param SS_HTTPRequest $r
* @return SS_HTTPResponse|void
* @throws SS_HTTPResponse_Exception
*/
public function handleSummit(SS_HTTPRequest $r)
{
if ($r->param('ID') == "active") {
$summit = Summit::get_active();
} else {
$summit = Summit::get()->byID($r->param('ID'));
}
if (!$summit) {
return $this->httpError(404, "That summit could not be found.");
}
if (!$summit->exists()) {
return $this->httpError(404, "There is no active summit.");
}
$data = $summit->toJSON();
$data['status'] = $summit->getStatus();
$data['on_voting_period'] = $summit->isVotingOpen();
$data['on_selection_period'] = $summit->isSelectionOpen();
$data['is_selection_period_over'] = $summit->isSelectionOver();
$data['categories'] = [];
$data['track_chair'] = $this->trackChairDetails();
$chairlist = [];
$categoriesIsChair = [];
$categoriesNotChair = [];
foreach ($summit->Categories()->filter('ChairVisible', true) as $c) {
$isChair = $c->isTrackChair(Member::currentUserID()) === 1;
$categoryDetials = ['id' => $c->ID, 'title' => $c->Title, 'description' => $c->Description, 'session_count' => $c->SessionCount, 'alternate_count' => $c->AlternateCount, 'summit_id' => $c->SummitID, 'user_is_chair' => $isChair];
if ($isChair) {
$categoriesIsChair[] = $categoryDetials;
} else {
$categoriesNotChair[] = $categoryDetials;
}
$chairs = $c->TrackChairs();
foreach ($chairs as $chair) {
$chairdata = [];
$chairdata['chair_id'] = $chair->ID;
$chairdata['first_name'] = $chair->Member()->FirstName;
$chairdata['last_name'] = $chair->Member()->Surname;
$chairdata['email'] = $chair->Member()->Email;
$chairdata['category'] = $c->Title;
$chairdata['category_id'] = $c->ID;
$chairlist[] = $chairdata;
}
}
$data['categories'] = array_merge($categoriesIsChair, $categoriesNotChair);
$data['chair_list'] = $chairlist;
return $this->ok($data);
}
示例8: validate
protected function validate()
{
$valid = parent::validate();
if (!$valid->valid()) {
return $valid;
}
$summit_id = isset($_REQUEST['SummitID']) ? $_REQUEST['SummitID'] : $this->SummitID;
$summit = Summit::get()->byID($summit_id);
if (!$summit) {
return $valid->error('Invalid Summit!');
}
$count = intval(SummitTicketType::get()->filter(array('SummitID' => $summit->ID, 'Name' => trim($this->Name), 'ID:ExactMatch:not' => $this->ID))->count());
if ($count > 0) {
return $valid->error(sprintf('Summit Ticket Type "%s" already exists!. please set another one', $this->Name));
}
return $valid;
}
示例9: CountdownDigits
public function CountdownDigits($current_submit_id = 0)
{
$summit = $current_submit_id > 0 ? Summit::get()->byId($current_submit_id) : $this->Summit();
if (is_null($summit)) {
return null;
}
$date = $summit->obj('SummitBeginDate');
if ($date->InPast()) {
return;
}
$exploded_date = explode(' ', $date->TimeDiffIn('days'), 3);
$days = str_pad($exploded_date[0], 3, '0', STR_PAD_LEFT);
$html = '';
foreach (str_split($days) as $digit) {
$html .= sprintf('<span>%s</span>', $digit);
}
return $html;
}
示例10: handleSummit
public function handleSummit(SS_HTTPRequest $r)
{
if ($r->param('ID') == "active") {
$summit = Summit::get_active();
} else {
$summit = Summit::get()->byID($r->param('ID'));
}
if (!$summit) {
return $this->httpError(404, "That summit could not be found.");
}
if (!$summit->exists()) {
return $this->httpError(404, "There is no active summit.");
}
$data = $summit->toJSON();
$data['status'] = $summit->getStatus();
$data['categories'] = array();
$data['track_chair'] = $this->trackChairDetails();
$chairlist = array();
$categoriesIsChair = array();
$categoriesNotChair = array();
foreach ($summit->Categories()->filter('ChairVisible', TRUE) as $c) {
$isChair = $c->isTrackChair(Member::currentUserID()) == 1;
$categoryDetials = array('id' => $c->ID, 'title' => $c->Title, 'description' => $c->Description, 'session_count' => $c->SessionCount, 'alternate_count' => $c->AlternateCount, 'summit_id' => $c->SummitID, 'user_is_chair' => $isChair);
if ($isChair) {
$categoriesIsChair[] = $categoryDetials;
} else {
$categoriesNotChair[] = $categoryDetials;
}
$chairs = $c->TrackChairs();
foreach ($chairs as $chair) {
$chairdata = array();
$chairdata['first_name'] = $chair->Member()->FirstName;
$chairdata['last_name'] = $chair->Member()->Surname;
$chairdata['email'] = $chair->Member()->Email;
$chairdata['category'] = $c->Title;
$chairlist[] = $chairdata;
}
}
$data['categories'] = array_merge($categoriesIsChair, $categoriesNotChair);
$data['chair_list'] = $chairlist;
return (new SS_HTTPResponse(Convert::array2json($data), 200))->addHeader('Content-Type', 'application/json');
}
示例11: handleSummit
public function handleSummit(SS_HTTPRequest $r)
{
if ($r->param('ID') == "active") {
$summit = Summit::get_active();
} else {
$summit = Summit::get()->byID($r->param('ID'));
}
if (!$summit) {
return $this->httpError(404, "That summit could not be found.");
}
if (!$summit->exists()) {
return $this->httpError(404, "There is no active summit.");
}
$data = $summit->toJSON();
$data['status'] = $summit->getStatus();
$data['categories'] = array();
foreach ($summit->getCategories() as $c) {
$data['categories'][] = $c->toJSON();
}
return (new SS_HTTPResponse(Convert::array2json($data), 200))->addHeader('Content-Type', 'application/json');
}
示例12: handleUpdateDefaultCategoryTags
public function handleUpdateDefaultCategoryTags($grid, $request, $data = null)
{
$summit_id = intval($request->param('ID'));
if ($summit_id > 0 && ($summit = Summit::get()->byID($summit_id))) {
$default_tags = $summit->CategoryDefaultTags();
foreach ($summit->Categories() as $category) {
$category_tags = $category->AllowedTags()->filter('IsDefault', 0);
$category->AllowedTags()->filter('IsDefault', 1)->removeAll();
foreach ($default_tags as $dtag) {
$found_tag = $category_tags->find('TagID', $dtag->TagID);
if ($found_tag && $found_tag->Group == $dtag->Group) {
continue;
}
if (!$found_tag) {
$found_tag = $dtag;
}
$category->AllowedTags()->remove($found_tag);
$category->AllowedTags()->add($dtag, array('Group' => $dtag->Group, 'IsDefault' => 1));
}
}
}
}
示例13: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new HTMLEditorField('HeaderArea', 'Page Header Area'), 'Content');
$fields->addFieldToTab('Root.Main', new HTMLEditorField('Sidebar', 'Right Sidebar Content'));
$fields->addFieldToTab('Root.Main', new HTMLEditorField('HeadlineSponsors', 'Headline Sponsors'));
$summits = Summit::get();
$SummitDropDownField = new DropdownField("SummitID", "Summit", $summits->map("ID", "Name"));
$fields->addFieldToTab('Root.Main', $SummitDropDownField);
//Google Conversion Tracking params
$fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionId", "Conversion Id", "994798451"));
$fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionLanguage", "Conversion Language", "en"));
$fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionFormat", "Conversion Format", "3"));
$fields->addFieldToTab("Root.GoogleConversionTracking", new ColorField("GAConversionColor", "Conversion Color", "ffffff"));
$fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionLabel", "Conversion Label", "IuM5CK3OzQYQ89at2gM"));
$fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionValue", "Conversion Value", "0"));
$fields->addFieldToTab("Root.GoogleConversionTracking", new CheckboxField("GARemarketingOnly", "Remarketing Only"));
//Facebook Conversion Params
$fields->addFieldToTab("Root.FacebookConversionTracking", new TextField("FBPixelId", "Pixel Id", "6013247449963"));
$fields->addFieldToTab("Root.FacebookConversionTracking", new TextField("FBValue", "Value", "0.00"));
$fields->addFieldToTab("Root.FacebookConversionTracking", new TextField("FBCurrency", "Currency", "USD"));
return $fields;
}
示例14: run
public function run($request)
{
$summit_id = intval($request->requestVar('SummitID'));
if ($summit_id <= 0) {
throw new RuntimeException("invalid summit id");
}
$summit = Summit::get()->byID($summit_id);
if (is_null($summit)) {
throw new RuntimeException("invalid summit");
}
$count = 0;
$presentations = Presentation::get()->filter(array('SummitID' => $summit_id, 'TypeID' => 0))->where(" Title IS NOT NULL AND Title <>'' ");
Summit::seedBasicEventTypes($summit_id);
$type = SummitEventType::get()->filter(array('Type' => 'Presentation', 'SummitID' => $summit_id))->first();
if (is_null($type)) {
throw new RuntimeException("invalid event type");
}
foreach ($presentations as $p) {
$p->TypeID = $type->ID;
$p->write();
++$count;
}
echo "Fixed {$count} presentations.";
}
示例15: getAllowedSchedule
public function getAllowedSchedule()
{
$summit = $this->Summit();
if (is_null($summit)) {
$summit = Summit::get()->byID(intval($_REQUEST['SummitID']));
}
return SummitEvent::get()->filter(array('Published' => true, 'SummitID' => $summit->ID));
}