%PDF- %PDF-
Direktori : /var/www/html/workeasy-api/app/Transformers/ |
Current File : /var/www/html/workeasy-api/app/Transformers/ExperienceTransformer.php |
<?php namespace Workeasy\Transformers; use Workeasy\Models\Experience; /** * Created by PhpStorm. * User: User * Date: 1/26/2018 * Time: 3:31 PM */ class ExperienceTransformer extends BaseTransformer { protected $availableIncludes = ['candidate']; public function includeCandidate(Experience $experience) { if ($experience = $experience->candidate) { return $this->item($experience, new CandidateTransformer, 'candidate'); } return null; } public function transform(Experience $experience) { $data = $this->transformColumns($experience); return $data; } protected function getTransformableColumns() { return [ 'id' => 'id', 'position' => 'position', 'company' => 'company', 'description' => 'description', 'start_date' => 'end_date', 'end_date' => 'end_date', 'candidate_id' => 'candidate_id', 'created_at' => 'created_at', 'updated_at' => 'updated_at', ]; } }