parent
82e52e12c6
commit
b08cab3c56
@ -90,6 +90,8 @@ final class EventRegistrationRequestFactory
|
||||
|
||||
$event = new EventPage;
|
||||
$event->Title = $request->Title;
|
||||
$event->ClassName = 'EventPage';
|
||||
$event->ParentID = 41;
|
||||
$event->EventLink = $request->Url;
|
||||
$event->EventLinkLabel = $request->Label;
|
||||
$event->EventStartDate = $request->StartDate;
|
||||
|
@ -26,6 +26,6 @@ final class SapphireEventPublishingService implements IEventPublishingService {
|
||||
if(!$parent) throw new NotFoundEntityException('EventHolder','');
|
||||
$event->setParent($parent); // Should set the ID once the Holder is created...
|
||||
$event->write();
|
||||
//$event->doPublish();
|
||||
$event->doPublish();
|
||||
}
|
||||
}
|
@ -116,13 +116,12 @@ final class EventRegistrationRequestManager {
|
||||
$event_repository = $this->event_repository;
|
||||
$event_publishing_service = $this->event_publishing_service;
|
||||
|
||||
return $this->tx_manager->transaction(function() use ($id, $repository, $event_repository, $factory, $event_publishing_service, $event_link){
|
||||
$event = $this->tx_manager->transaction(function() use ($id, $repository, $event_repository, $factory, $event_publishing_service, $event_link){
|
||||
$request = $repository->getById($id);
|
||||
if(!$request) throw new NotFoundEntityException('EventRegistrationRequest',sprintf('id %s',$id ));
|
||||
$event = $factory->buildEvent($request);
|
||||
$event_repository->add($event);
|
||||
$request->markAsPosted();
|
||||
$event_publishing_service->publish($event);
|
||||
|
||||
//send Accepted message
|
||||
$point_of_contact = $request->getPointOfContact();
|
||||
@ -139,6 +138,9 @@ final class EventRegistrationRequestManager {
|
||||
|
||||
return $event;
|
||||
});
|
||||
|
||||
$event_publishing_service->publish($event);
|
||||
return $event;
|
||||
}
|
||||
|
||||
public function updateEventRegistrationRequest(array $data){
|
||||
|
@ -50,21 +50,21 @@ class EventHolder_Controller extends Page_Controller {
|
||||
}
|
||||
|
||||
function PastEvents($num = 4) {
|
||||
return EventPage::get()->filter(array('EventEndDate:LessThanOrEqual'=>'now()', 'IsSummit'=>1))->sort('EventEndDate')->limit($num);
|
||||
return EventPage::get()->filter(array('EventEndDate:LessThanOrEqual'=> date('Y-m-d') , 'IsSummit'=>1))->sort('EventEndDate')->limit($num);
|
||||
}
|
||||
|
||||
|
||||
function FutureEvents($num) {
|
||||
return EventPage::get()->filter(array('EventEndDate:GreaterThanOrEqual'=>'now()'))->sort('EventStartDate','ASC')->limit($num);
|
||||
return EventPage::get()->filter(array('EventEndDate:GreaterThanOrEqual'=> date('Y-m-d') ))->sort('EventStartDate','ASC')->limit($num);
|
||||
}
|
||||
|
||||
function PastSummits($num) {
|
||||
return EventPage::get()->filter(array('EventEndDate:LessThanOrEqual'=>'now()', 'IsSummit'=>1))->sort('EventEndDate','DESC')->limit($num);
|
||||
return EventPage::get()->filter(array('EventEndDate:LessThanOrEqual'=> date('Y-m-d') , 'IsSummit'=>1))->sort('EventEndDate','DESC')->limit($num);
|
||||
}
|
||||
|
||||
|
||||
function FutureSummits($num) {
|
||||
return EventPage::get()->filter(array('EventEndDate:GreaterThanOrEqual'=>'now()', 'IsSummit'=>1))->sort('EventStartDate','ASC')->limit($num);
|
||||
return EventPage::get()->filter(array('EventEndDate:GreaterThanOrEqual'=> date('Y-m-d') , 'IsSummit'=>1))->sort('EventStartDate','ASC')->limit($num);
|
||||
}
|
||||
|
||||
public function getEvents($num = 4, $type) {
|
||||
|
Loading…
Reference in New Issue
Block a user