BodyTemplatesTransformer.php 558 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: hp
  5. * Date: 2017/11/21
  6. * Time: 10:53
  7. */
  8. namespace App\Http\Controllers\Channel\Promotion\Transformers;
  9. /**
  10. * Class BodyTemplatesTransformer 内容模板
  11. * @package App\Modules\Promotion\Transformers
  12. */
  13. class BodyTemplatesTransformer
  14. {
  15. public function transform($bodyTemplatesItem)
  16. {
  17. return [
  18. 'id' => $bodyTemplatesItem->id,
  19. 'content' => $bodyTemplatesItem->content,
  20. 'style'=>isset($bodyTemplatesItem->style)?$bodyTemplatesItem->style:''
  21. ];
  22. }
  23. }