<?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($nwpmB = null) { goto cFU4h; FA6jR: return $this; goto f93OO; GK0N4: $this->addVariables(array('scope' => $nwpmB)); goto FA6jR; cFU4h: if (null == $nwpmB) { return $this->getVariable('scope'); } goto GK0N4; f93OO: } public function unserializeValue($gbkxa, AbstractField $iuKOG) { goto jtips; vsEjW: if (empty($gbkxa['driver'])) { $gbkxa['driver'] = null; } goto pRbDn; LU1Gi: if (empty($gbkxa['path'])) { $gbkxa['path'] = null; } goto pvZS4; pvZS4: return $gbkxa; goto GunRC; jtips: $gbkxa = json_decode($gbkxa, true); goto vsEjW; pRbDn: if (empty($gbkxa['name'])) { $gbkxa['name'] = null; } goto LU1Gi; GunRC: } public function serializeValue($gbkxa, $IEBqF) { return json_encode($gbkxa, JSON_UNESCAPED_UNICODE); } public function prepareInput($gbkxa, $IEBqF) { return json_decode($gbkxa, true); } public static function register() { FieldManager::extend('videoStream', VideoStreamField::class); } }