<?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($SLm7t = null) { goto nGc8Z; YNoJ0: if (is_string($SLm7t) && is_subclass_of($SLm7t, BaseType::class)) { goto wgD7q; Hogof: foreach ($SLm7t::getList() as $B34tD => $Xz28r) { $Mczr_[] = array('id' => $B34tD, 'pid' => 0, 'title' => $Xz28r, 'sort' => $SkFRe++); } goto JLuFF; SGJzT: $SkFRe = 1; goto Hogof; wgD7q: $Mczr_ = array(); goto SGJzT; JLuFF: } else { if (is_array($SLm7t)) { $Mczr_ = $SLm7t; } else { BizException::throws('Select nodes error'); } } goto TB2SN; nGc8Z: if (null === $SLm7t) { return $this->nodes; } goto YNoJ0; TB2SN: $this->nodes = $Mczr_; goto WLE8G; WLE8G: } }