初始化环境
@return null
182569
function __init()
    {
        #DEBUG
        if (defined('DEBUG') and strtolower(DEBUG) == 'on')
        {
            //记录运行时间和内存占用情况
            $this->env['runtime']['start'] = microtime(true);
            $this->env['runtime']['mem'] = memory_get_usage();
            //使用whoops美化错误页面
            if (class_exists('\\Whoops\\Run'))
            {
                $whoops = new \Whoops\Run;
                if ($this->env['sapi_name'] == 'cli')
                {
                    $whoops->pushHandler(new \Whoops\Handler\PlainTextHandler());
                }
                else
                {
                    $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
                }
                $whoops->register();
            }
        }
        $this->callHook(self::HOOK_INIT);
    }
1314395
public function getValue() : ?string
    {
        foreach ($this->getOptions() as $option) {
            if ($option->isSelected()) {
                return $option->getValue();
            }
        }

        return null;
    }
625347
public function save(): void
    {
        $keys = [];

        $primaryKey = $this->primaryKey;

        //每个行对象进行保存
        foreach ($this as $record) {
            /*
             * @var SRecord
             */
            $record->save();

            //取行对象的主键值
            $keys[] = $record->{$primaryKey};
        }

        //要删除的记录的主键值
        $deletedKeys = array_diff($this->oldPrimaryKeys, $keys);

        //一对多时,在关联表中进行删除
        if ($this->type === 'hasMany') {
            /**
             * @var $tableClass Table
             */
            $tableClass = $this->tableClass;
            $tableClass::instance()->delete([$this->primaryKey => $deletedKeys]);
        } elseif ($this->type === 'belongsToMany') {
            //多对多关联时,删除 中间表
            $config = $this->relation;

            //配置信息
            $middleClass = $config['middle'];  //中间表
            $selfForeignKey = $config['selfForeignKey'];//中间表中与本表关联的键
            $targetForeignKey = $config['targetForeignKey'];//中间表中与对方 表关联的键
            $selfPrimaryValue = $config['selfPrimaryValue']; //主表主键值

            //在中间表中进行删除
            $middleClass::instance()->delete([$selfForeignKey => $selfPrimaryValue, $targetForeignKey => $deletedKeys]);
        }
    }
150752
public function key() {
		$keys = array_keys($this->data);
		return isset($keys[$this->position]) ? $keys[$this->position] : null;
	}
1009352
public function manage()
    {
        $this->initLoop();

        /**
         * @var \ZMQContext
         */
        $this->context = new Context($this->loop);
        $this->initStreams();

        $this->pmReplySocket = $this->context->getSocket(\ZMQ::SOCKET_REP);

        $this->dtoContainer = new DtoContainer();
        $this->dtoContainer->setDto(new LmStateDto());
        $this->commandsManager = new CommandsManager();

        $this->declareGettingLmParams();

        $this->managingTimer();

        $this->loop->run();

        return null;
    }
900968
public function read() {
        $cookie = $this->Cookie->read($this->cookieName);

        if (empty($cookie) || !is_array($cookie)) {
            return null;
        }

        if (isset($cookie['username'])) {
            $cookie['username'] = base64_decode($cookie['username']);
        }

        if (isset($cookie['password'])) {
            $cookie['password'] = base64_decode($cookie['password']);
        }

        return $cookie;
    }
345088
public function read()
    {
        if ($this->_user !== null) {
            return $this->_user ?: null;
        }

        $this->_user = $this->_session->read($this->_config['key']) ?: false;

        return $this->_user ?: null;
    }
1340498
public function current()
    {
        if (!is_array($this->val)) {
            return null;
        }
        if ($this->assocArray) {
            $keys = array_keys($this->val);
            return $this->val[$keys[$this->position]];
        }

        return $this->val[$this->position];
    }
253621
public function valid()
    {
        if (!$this->splFileObject->valid()) {
            return false;
        }

        if ($this->splFileObject->key() === 0) {
            $this->splFileObject->next();
        }

        $current = $this->splFileObject->current();

        return $current <> [null];
    }
647568
public function getUpdatedBy()
    {
        $updatedByAttribute = $this->updatedByAttribute;
        return (!is_string($updatedByAttribute) || empty($updatedByAttribute)) ? null : $this->$updatedByAttribute->getData();
    }
818269
public function getValue()
    {
        return ($this->value !== null && $this->value !== '') ? $this->value : $this->getAttribute('default');
    }
741999
public function current()
    {
        if (isset($this->keys[$this->pos])) {
            return $this->getAt($this->keys[$this->pos]);
        }
        return null;
    }
1020686
private function startCommon(): void
    {
        if (self::$app !== null) {
            return;
        }
        self::$app = $this;
        // 加载框架配置文件
        $config = DataMap::loadFromPhpFile($this->mvcSourcePath . '/../config.inc.php');
        // 应用配置
        if ($this->config === null) {
            $appConfigFile = APP_CONFIG_PATH . '/./config.inc.php';
            if (is_file($appConfigFile)) {
                $appConfig = DataMap::loadFromPhpFile($appConfigFile);
                $config->mergeData($appConfig);
            }
        } else {
            $config->mergeData($this->config);
        }
        $this->config = $config;
        $this->loadContainer();
    }
662164
public function getDataValue()
    {
        $count = count($this->dataValues);
        if ($count == 0) {
            return null;
        } elseif ($count == 1) {
            return $this->dataValues[0];
        }
        return $this->dataValues;
    }
597487
public function getCode()
    {
        if (!$this->isSuccessful() && isset($this->data['error']) && isset($this->data['error']['code'])) {
            return $this->data['error']['code'];
        }

        return null;
    }
470198
public function current()
    {
        return isset($this->mappedEnums[$this->iteratorIndex])
            ? $this->valueMap[$this->mappedEnums[$this->iteratorIndex]->getConstName()]
            : null;
    }
1122878
public function get_value() {
		if ( $this->group && null === $this->value ) {
			return $this->value = $this->get_value_in_group();
		}

		return $this->value;
	}