<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\VideoStream; use ModStart\Core\Util\SerializeUtil; use ModStart\Field\AbstractField; use ModStart\Support\Manager\FieldManager; class VideoStreamField extends AbstractField { const SCOPE_ADMIN = 'admin'; const SCOPE_MEMBER = 'member'; protected $view = 'module::Vendor.View.field.videoStream'; protected $value = array('driver' => null, 'name' => null, 'path' => null); protected function setup() { parent::setup(); $this->addVariables(array('scope' => self::SCOPE_ADMIN)); } public function scope($MsVRI = null) { goto Ym57y; Ym57y: if (null == $MsVRI) { return $this->getVariable('scope'); } goto K_5m5; ONnUK: return $this; goto N8EjB; K_5m5: $this->addVariables(array('scope' => $MsVRI)); goto ONnUK; N8EjB: } public function unserializeValue($jkY57, AbstractField $jJyrp) { goto heMm5; UBifQ: return $jkY57; goto Li12E; TbPsm: if (empty($jkY57['name'])) { $jkY57['name'] = null; } goto CaBi8; heMm5: $jkY57 = json_decode($jkY57, true); goto G4s7e; CaBi8: if (empty($jkY57['path'])) { $jkY57['path'] = null; } goto UBifQ; G4s7e: if (empty($jkY57['driver'])) { $jkY57['driver'] = null; } goto TbPsm; Li12E: } public function serializeValue($jkY57, $AYucL) { return SerializeUtil::jsonEncode($jkY57, JSON_UNESCAPED_UNICODE); } public function prepareInput($jkY57, $AYucL) { return json_decode($jkY57, true); } public static function register() { FieldManager::extend('videoStream', VideoStreamField::class); } }