Updated getEvents endpoints
* added filtering by speaker_title ( speaker/moderator) speaker_company ( speaker/moderator) * updated csv serializer added speaker_titles, speaker_companies moderator_title, moderator_company Change-Id: I42f20ceec0d2231a191b6345580a88c68c2d7929 Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
parent
ccc7f090a0
commit
bc7d10ecfa
@ -141,6 +141,8 @@ abstract class RetrieveSummitEventsStrategy
|
||||
'location_id' => ['=='],
|
||||
'speaker' => ['=@', '=='],
|
||||
'speaker_email' => ['=@', '=='],
|
||||
'speaker_title' => ['=@', '=='],
|
||||
'speaker_company' => ['=@', '=='],
|
||||
'selection_status' => ['=='],
|
||||
'id' => ['=='],
|
||||
'selection_plan_id' => ['=='],
|
||||
@ -159,6 +161,8 @@ abstract class RetrieveSummitEventsStrategy
|
||||
'level' => 'sometimes|string',
|
||||
'speaker' => 'sometimes|string',
|
||||
'speaker_email' => 'sometimes|string',
|
||||
'speaker_title' => 'sometimes|string',
|
||||
'speaker_company' => 'sometimes|string',
|
||||
'start_date' => 'sometimes|date_format:U',
|
||||
'end_date' => 'sometimes|date_format:U',
|
||||
'summit_type_id' => 'sometimes|integer',
|
||||
|
@ -39,9 +39,13 @@ final class AdminPresentationCSVSerializer extends AdminPresentationSerializer
|
||||
$serializerType = SerializerRegistry::SerializerType_Private;
|
||||
}
|
||||
|
||||
// moderator data
|
||||
|
||||
$values['moderator_id'] = "";
|
||||
$values['moderator_full_name'] = "";
|
||||
$values['moderator_email'] = "";
|
||||
$values['moderator_title'] = "";
|
||||
$values['moderator_company'] = "";
|
||||
|
||||
if(isset($values['moderator_speaker_id']))
|
||||
unset($values['moderator_speaker_id']);
|
||||
@ -50,27 +54,39 @@ final class AdminPresentationCSVSerializer extends AdminPresentationSerializer
|
||||
$values['moderator_id'] = $presentation->getModerator()->getId();
|
||||
$values['moderator_full_name'] = $presentation->getModerator()->getFullName();
|
||||
$values['moderator_email'] = $presentation->getModerator()->getEmail();
|
||||
$values['moderator_title'] = trim($presentation->getModerator()->getTitle());
|
||||
$values['moderator_company'] = trim($presentation->getModerator()->getCompany());
|
||||
}
|
||||
|
||||
// speaker data
|
||||
|
||||
$values['speaker_ids'] = "";
|
||||
$values['speaker_fullnames'] = "";
|
||||
$values['speaker_emails'] = "";
|
||||
$values['speaker_titles'] = "";
|
||||
$values['speaker_companies'] = "";
|
||||
|
||||
if($presentation->getSpeakers()->count() > 0){
|
||||
|
||||
$speaker_ids = [];
|
||||
$speaker_fullnames = [];
|
||||
$speaker_emails = [];
|
||||
$speaker_titles = [];
|
||||
$speaker_companies = [];
|
||||
|
||||
foreach ($presentation->getSpeakers() as $speaker) {
|
||||
$speaker_ids[] = $speaker->getId();
|
||||
$speaker_fullnames[] = $speaker->getFullName();
|
||||
$speaker_emails[] = $speaker->getEmail();
|
||||
$speaker_titles[] = trim($speaker->getTitle());
|
||||
$speaker_companies[] = trim($speaker->getCompany());
|
||||
}
|
||||
|
||||
$values['speaker_ids'] = implode("|", $speaker_ids);
|
||||
$values['speaker_fullnames'] = implode("|", $speaker_fullnames);
|
||||
$values['speaker_emails'] = implode("|", $speaker_emails);
|
||||
$values['speaker_titles'] = implode("|", $speaker_titles);
|
||||
$values['speaker_companies'] = implode("|", $speaker_companies);
|
||||
}
|
||||
|
||||
if(isset($values['description'])){
|
||||
@ -109,6 +125,7 @@ final class AdminPresentationCSVSerializer extends AdminPresentationSerializer
|
||||
$values['extra_questions'] = $values['extra_questions'] . '|';
|
||||
$values['extra_questions'] = $values['extra_questions'] . str_replace(",", "", (string)$answer);
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
}
|
@ -1744,17 +1744,17 @@ SQL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCompany()
|
||||
public function getCompany():?string
|
||||
{
|
||||
return $this->company;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $company
|
||||
* @param string $company
|
||||
*/
|
||||
public function setCompany($company): void
|
||||
public function setCompany(string $company): void
|
||||
{
|
||||
$this->company = $company;
|
||||
}
|
||||
|
@ -163,6 +163,14 @@ final class DoctrineSummitEventRepository
|
||||
(
|
||||
"(sprr.email :operator :value OR spmm.email :operator :value OR spmm2.email :operator :value OR sprr2.email :operator :value)"
|
||||
),
|
||||
'speaker_title' => new DoctrineFilterMapping
|
||||
(
|
||||
"(sp.title :operator :value OR spm.title :operator :value)"
|
||||
),
|
||||
'speaker_company' => new DoctrineFilterMapping
|
||||
(
|
||||
"(sp.company :operator :value OR spm.company :operator :value)"
|
||||
),
|
||||
'speaker_id' => new DoctrineFilterMapping
|
||||
(
|
||||
"(sp.id :operator :value OR spm.id :operator :value)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user