<?php
/**
 * Created by PhpStorm.
 * User:  NODELOG
 * Date: 2017/3/8
 * Time: 下午11:21
 */

namespace api\common\models;


use yii\helpers\ArrayHelper;


class CarouselItem extends \common\models\CarouselItem

{

    /**
     * @return array|false
     */
    public function fields()
    {
        return ArrayHelper::merge(parent::fields(), [
            'link' => function ($model) {
                /* @var self $model */
                return $model->url;
            },
            'url' => function ($model) {
                /* @var self $model */
                return $model->image;
            },
        ]);
    }

}