<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Grid\Filter\Field; use ModStart\Core\Exception\BizException; use ModStart\Core\Type\BaseType; class Cascader extends AbstractFilterField { protected $nodes = array(); protected function setup() { $this->addFluentAttributeVariable('nodes'); } public function nodes($UAm9P = null) { goto q0arl; q0arl: if (null === $UAm9P) { return $this->nodes; } goto v5QIh; v5QIh: if (is_string($UAm9P) && is_subclass_of($UAm9P, BaseType::class)) { goto VqTq3; NsJNM: foreach ($UAm9P::getList() as $GBNIv => $VFelt) { $gwXrh[] = array('id' => $GBNIv, 'pid' => 0, 'title' => $VFelt, 'sort' => $vq__Q++); } goto uCX_V; VqTq3: $gwXrh = array(); goto VESct; VESct: $vq__Q = 1; goto NsJNM; uCX_V: } else { if (is_array($UAm9P)) { $gwXrh = $UAm9P; } else { BizException::throws('Select nodes error'); } } goto LtlAM; LtlAM: $this->nodes = $gwXrh; goto QhrHl; QhrHl: } }