<?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($pAVau = null) { goto bu4Yb; bu4Yb: if (null == $pAVau) { return $this->getVariable('scope'); } goto WVXFC; EvP8X: return $this; goto I_wpQ; WVXFC: $this->addVariables(array('scope' => $pAVau)); goto EvP8X; I_wpQ: } public function unserializeValue($VRDYW, AbstractField $TMEcx) { goto oCtuK; oCtuK: $VRDYW = json_decode($VRDYW, true); goto edRK2; mtWn_: if (empty($VRDYW['name'])) { $VRDYW['name'] = null; } goto KGrsm; edRK2: if (empty($VRDYW['driver'])) { $VRDYW['driver'] = null; } goto mtWn_; KGrsm: if (empty($VRDYW['path'])) { $VRDYW['path'] = null; } goto y_Jzn; y_Jzn: return $VRDYW; goto NSp9F; NSp9F: } public function serializeValue($VRDYW, $elgkL) { return json_encode($VRDYW, JSON_UNESCAPED_UNICODE); } public function prepareInput($VRDYW, $elgkL) { return json_decode($VRDYW, true); } public static function register() { FieldManager::extend('videoStream', VideoStreamField::class); } }