<?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($m76VU = null) { goto uoKVN; uoKVN: if (null == $m76VU) { return $this->getVariable('scope'); } goto OpMAh; OpMAh: $this->addVariables(array('scope' => $m76VU)); goto zqX2f; zqX2f: return $this; goto ZKbt1; ZKbt1: } public function unserializeValue($sKrwM, AbstractField $AlE6h) { goto RqrOn; CseoP: if (empty($sKrwM['name'])) { $sKrwM['name'] = null; } goto X8Ymo; NW9M6: return $sKrwM; goto omp4U; X8Ymo: if (empty($sKrwM['path'])) { $sKrwM['path'] = null; } goto NW9M6; RqrOn: $sKrwM = json_decode($sKrwM, true); goto Rb0gJ; Rb0gJ: if (empty($sKrwM['driver'])) { $sKrwM['driver'] = null; } goto CseoP; omp4U: } public function serializeValue($sKrwM, $o01Zr) { return json_encode($sKrwM, JSON_UNESCAPED_UNICODE); } public function prepareInput($sKrwM, $o01Zr) { return json_decode($sKrwM, true); } public static function register() { FieldManager::extend('videoStream', VideoStreamField::class); } }