<?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($eMxE7 = null) { goto G1QjA; G1QjA: if (null == $eMxE7) { return $this->getVariable('scope'); } goto vDzF_; ouDqL: return $this; goto zqZls; vDzF_: $this->addVariables(array('scope' => $eMxE7)); goto ouDqL; zqZls: } public function unserializeValue($L58zW, AbstractField $aR4e2) { goto PL1zz; R4d56: if (empty($L58zW['driver'])) { $L58zW['driver'] = null; } goto oldMB; oldMB: if (empty($L58zW['name'])) { $L58zW['name'] = null; } goto SAisw; SAisw: if (empty($L58zW['path'])) { $L58zW['path'] = null; } goto h1MHU; PL1zz: $L58zW = json_decode($L58zW, true); goto R4d56; h1MHU: return $L58zW; goto OqzXL; OqzXL: } public function serializeValue($L58zW, $VShxB) { return json_encode($L58zW, JSON_UNESCAPED_UNICODE); } public function prepareInput($L58zW, $VShxB) { return json_decode($L58zW, true); } public static function register() { FieldManager::extend('videoStream', VideoStreamField::class); } }