/** * @param IJobRegistrationRequest $request * @return array */ public static function convertJobRegistrationRequestToArray(IJobRegistrationRequest $request) { $res = array(); $main_info = $request->getMainInfo(); $res['title'] = $main_info->getTitle(); $res['url'] = $main_info->getUrl(); $res['description'] = $main_info->getDescription(); $res['instructions'] = $main_info->getInstructions(); $res['company_name'] = $main_info->getCompany()->Name; $res['location_type'] = $main_info->getLocationType(); $expiration_date = $main_info->getExpirationDate(); if (!is_null($expiration_date)) { $res['expiration_date'] = $expiration_date->format('Y-m-d'); } $point_of_contact = $request->getPointOfContact(); $res['point_of_contact_name'] = $point_of_contact->getName(); $res['point_of_contact_email'] = $point_of_contact->getEmail(); $locations = array(); foreach ($request->getLocations() as $location) { $l = array(); $l['city'] = $location->city(); $l['state'] = $location->state(); $l['country'] = $location->country(); array_push($locations, $l); } $res['locations'] = $locations; return $res; }
/** * @param IJobRegistrationRequest $request * @return IJob */ public function buildJob(IJobRegistrationRequest $request) { $job = new Job(); $job->PostedDate = $request->PostDate; // company name logic $job->CompanyID = intval($request->CompanyID); if ($job->CompanyID == 0) { $job->CompanyName = intval($request->CompanyName); } $job->ExpirationDate = $request->ExpirationDate; $job->Description = $request->Description; $job->Title = $request->Title; $job->MoreInfoLink = $request->Url; $job->Instructions2Apply = $request->Instructions2Apply; $job->LocationType = $request->LocationType; $job->IsCOANeeded = $request->IsCOANeeded; $job->TypeID = $request->TypeID; //locations foreach ($request->getLocations() as $location) { $job->addLocation($location); } return $job; }
/** * @param IJobRegistrationRequest $request * @return IJob */ public function buildJob(IJobRegistrationRequest $request) { $job = new JobPage(); $job->JobPostedDate = $request->PostDate; $job->JobCompany = $request->CompanyName; $job->JobCompany = $request->CompanyName; $job->ExpirationDate = $request->ExpirationDate; $job->Content = $request->Description; $job->Title = $request->Title; $job->JobMoreInfoLink = $request->Url; $job->JobInstructions2Apply = $request->Instructions2Apply; $job->LocationType = $request->LocationType; foreach ($request->getLocations() as $location) { $job->addLocation($location); } return $job; }