自动关联数据写入（针对一对一关联）
@access public
@return void
169014
protected function autoRelationInsert()
    {
        foreach ($this->relationWrite as $name => $val) {
            $method = Db::parseName($name, 1, false);
            $this->$method()->save($val);
        }
    }
1341358
public function init() {

		parent::init();

		$this->countryService	= Yii::$app->factory->get( 'countryService' );
		$this->provinceService 	= Yii::$app->factory->get( 'provinceService' );
		$this->regionService 	= Yii::$app->factory->get( 'regionService' );
		$this->addressService	= Yii::$app->factory->get( 'addressService' );
	}
1076766
public function init() {
    parent::init();
    if (empty($this->options['id'])) {
      $this->options['id'] = $this->getId();
    }
  }
916936
public function close() {
        if (!empty($this->_fp)) {
            fclose($this->_fp);
            $this->_fp = null;
        }
    }
1154297
public function end(): void
    {
        $this->current = $this->tail->prev();
        $this->offset = $this->count - 1;
    }
37734
public function reset()
    {
        $this->values[self::ID] = null;
        $this->values[self::PUBLICKEY] = null;
        $this->values[self::PRIVATEKEY] = null;
    }
924057
private function storeCurrentItem() : void
    {
        $key = $this->iterator->key();

        if ($key === null) {
            return;
        }

        $this->items[$key] = $this->iterator->current();
    }
842775
private function readCurrent() : void
    {
        $row = $this->readRow();

        if ($this->columns === null || $row === null) {
            $this->current = $row;
        } else {
            $this->current = [];

            foreach ($this->columns as $key => $name) {
                $this->current[$name] = isset($row[$key]) ? $row[$key] : null;
            }
        }
    }
415481
public function handle()
    {
        $message = trim($this->argument('message'));

        $topicName = trim($this->option('topic'));
        $tag = trim($this->option('tag'));

        /**
         * @var Client
         */
        $client = $this->mns;
        if (!$client) {
            $this->error('请先配置阿里云MSN服务，并在DI里面注册');

            return;
        }

        //
        $topic = $client->getTopicRef($topicName);
        try {
            $request = new PublishMessageRequest($message, $tag);
            $res = $topic->publishMessage($request);
            if ($res->isSucceed()) {
                $this->line('Topic Message published');
                $this->output->newLine();
                $this->call('mns:list-topic');
            }
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
    }
734008
public function execute()
    {
        $this->insertID = $this->table->insertOne($this->context + $this->data);
        parent::execute();
    }
866125
public function disconnect(): void
  {
    if ($this->mysqli!==null)
    {
      $this->mysqli->close();
      $this->mysqli = null;
    }
  }
619561
public function handle()
    {
        do {
            if (!isset($validator) || $validator->errors()->has("username")) {
                if (isset($validator) && $validator->errors()->has("username")) {
                    $this->error($validator->errors()->first("username"));
                }
                $data["username"] = $this->ask("User's username: ");
            }

            if (!isset($validator) || $validator->errors()->has("firstname")) {
                if (isset($validator) && $validator->errors()->has("firstname")) {
                    $this->error($validator->errors()->first("firstname"));
                }
                $data["firstname"] = $this->ask("User's firstname: ");
            }

            if (!isset($validator) || $validator->errors()->has("lastname")) {
                if (isset($validator) && $validator->errors()->has("lastname")) {
                    $this->error($validator->errors()->first("lastname"));
                }
                $data["lastname"] = $this->ask("User's lastname: ");
            }

            if (!isset($validator) || $validator->errors()->has("email")) {
                if (isset($validator) && $validator->errors()->has("email")) {
                    $this->error($validator->errors()->first("email"));
                }
                $data["email"] = $this->ask("User's email: ");
                $data["email_confirmation"] = $this->ask("Email again: ");
            }

            if (!isset($validator) || $validator->errors()->has("password")) {
                if (isset($validator) && $validator->errors()->has("password")) {
                    $this->error($validator->errors()->first("password"));
                }
                $data["password"] = $this->secret("User's password: ");
                $data["password_confirmation"] = $this->secret("Password again: ");
            }

            $validator = new Validator;

            $validator = Validator::make($data, [
                'username' => 'required',
                'firstname' => 'required',
                'lastname' => 'required',
                'email' => 'required|unique:admin_users,email|confirmed',
                'password' => 'required|confirmed'
            ]);
        } while ($validator->fails());

        $user = new AdminUser;
        $user->username = $data["username"];
        $user->firstname = $data["firstname"];
        $user->lastname = $data["lastname"];
        $user->email = $data["email"];
        $user->is_active = true;
        $user->password = bcrypt($data["password"]);
        $user->save();

        $user->addRoleByName('administrator');
    }
486562
public function clear(): bool {
        $this->heap = \array_fill(0, $this->maxSize, null);
        $this->heap[0] = \PHP_INT_MIN;
        return \count($this->heap) === 1 && $this->heap[0] === \PHP_INT_MIN;
    }
671433
public function pass() {
    if ($this->output && !$this->output->isQuiet()) {
      $this->output->write(".");
    }
    $this->passed += 1;
  }
1342485
public function init()
	{
		parent::init();

		$db=$this->getDbConnection();
		$db->setActive(true);
		if($this->autoCreateCacheTable)
		{
			$sql="DELETE FROM {$this->cacheTableName} WHERE expire>0 AND expire<".time();
			try
			{
				$db->createCommand($sql)->execute();
			}
			catch(Exception $e)
			{
				$this->createCacheTable($db,$this->cacheTableName);
			}
		}
	}
1311480
public function cut()
    {
        $this->data = substr($this->data, $this->position);
        if ($this->data === false) {
            $this->data = '';
        }

        $this->position = 0;
    }
560271
public static function begin(): void
  {
    $ret = self::$mysqli->autocommit(false);
    if (!$ret) self::mySqlError('mysqli::autocommit');
  }