%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/workeasy-api/app/Transformers/
Upload File :
Create Path :
Current File : /var/www/html/workeasy-api/app/Transformers/InterviewTransformer.php

<?php

namespace Workeasy\Transformers;

use Workeasy\Models\Interview;

/**
 * Created by PhpStorm.
 * User: User
 * Date: 1/26/2018
 * Time: 3:31 PM
 */
class InterviewTransformer extends BaseTransformer
{
    protected $availableIncludes = ['candidate', 'offer'];

    public function includeCandidate(Interview $interview)
    {
        return $this->item($interview->candidate, new CandidateTransformer, 'candidate');
    }

    public function includeOffer(Interview $interview)
    {
        return $this->item($interview->offer, new OfferTransformer, 'offer');
    }

    public function transform(Interview $interview)
    {
        $data = $this->transformColumns($interview);
        return $data;
    }

    protected function getTransformableColumns()
    {
        return [
            'id'           => 'id',
            'candidate_id' => 'candidate_id',
            'offer_id'     => 'offer_id',
            'status'       => 'status',
            'created_at'   => 'created_at',
            'updated_at'   => 'updated_at',
        ];
    }

}

Zerion Mini Shell 1.0