Esempio n. 1
0
 /**
  * Returns the standardized job object
  *
  * @param array $payload
  *
  * @return \JobBrander\Jobs\Client\Job
  */
 public function createJobObject($payload)
 {
     $defaults = ['jobTitle', 'company', 'location', 'date', 'detailUrl'];
     $payload = static::parseAttributeDefaults($payload, $defaults);
     $job = new Job(['title' => $payload['jobTitle'], 'name' => $payload['jobTitle'], 'url' => $payload['detailUrl'], 'location' => $payload['location']]);
     $location = static::parseLocation($payload['location']);
     $job->setCompany($payload['company'])->setDatePostedAsString($payload['date']);
     if (isset($location[0])) {
         $job->setCity($location[0]);
     }
     if (isset($location[1])) {
         $job->setState($location[1]);
     }
     return $job;
 }
Esempio n. 2
0
 /**
  * Returns the standardized job object
  *
  * @param array $payload
  *
  * @return \JobBrander\Jobs\Client\Job
  */
 public function createJobObject($payload)
 {
     $defaults = ['title', 'date', 'onclick', 'company', 'city', 'description', 'price', 'id', 'industry0'];
     $payload = static::parseAttributeDefaults($payload, $defaults);
     $job = new Job(['title' => $payload['title'], 'name' => $payload['title'], 'description' => $payload['description'], 'javascriptFunction' => $payload['onclick'], 'javascriptAction' => 'onclick', 'sourceId' => $payload['id'], 'industry' => $payload['industry0']]);
     $location = static::parseLocation($payload['city']);
     $job->setDatePostedAsString($payload['date'])->setCompany($payload['company']);
     if (isset($location[0])) {
         $job->setCity($location[0]);
     }
     if (isset($location[1])) {
         $job->setState($location[1]);
     }
     return $job;
 }
Esempio n. 3
0
 /**
  * Attempt to parse and add location to Job
  *
  * @param Job     $job
  * @param string  $location
  *
  * @return  Job
  */
 private function setJobLocation(Job $job, $location)
 {
     $location = static::parseLocation($location);
     if (isset($location[0])) {
         $job->setCity($location[0]);
     }
     if (isset($location[1])) {
         $job->setState($location[1]);
     }
     return $job;
 }