<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\VideoStream; 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($EqGIJ = null) { goto KyYbo; KyYbo: if (null == $EqGIJ) { return $this->getVariable('scope'); } goto C4O3i; C4O3i: $this->addVariables(array('scope' => $EqGIJ)); goto uPPrx; uPPrx: return $this; goto sUvMs; sUvMs: } public function unserializeValue($fo71I, AbstractField $pZ_lR) { goto Yc0IB; HK7LO: if (empty($fo71I['driver'])) { $fo71I['driver'] = null; } goto u0H6a; Yc0IB: $fo71I = json_decode($fo71I, true); goto HK7LO; GCGlI: if (empty($fo71I['path'])) { $fo71I['path'] = null; } goto si2GB; u0H6a: if (empty($fo71I['name'])) { $fo71I['name'] = null; } goto GCGlI; si2GB: return $fo71I; goto WFGUO; WFGUO: } public function serializeValue($fo71I, $H1X6o) { return json_encode($fo71I, JSON_UNESCAPED_UNICODE); } public function prepareInput($fo71I, $H1X6o) { return json_decode($fo71I, true); } public static function register() { FieldManager::extend('videoStream', VideoStreamField::class); } }