检查boolean
@return $this
546694
public function boolean() {
        $this->check_role = 'boolean';
        $result = in_array($this->value, [true, false, 0, 1, '0', '1'], true);
        $this->checkResult($result);
        return $this;
    }
661039
public function setSatisfied($bool = true)
    {
        $storage = $this->getStorage()->read() ?: [];
        $storage['is_satisfied'] = $bool;
        $this->getStorage()->write($storage);

        return $this;
    }
772197
public function setValue($value) {
        switch ($this->type) {
            case self::TYPE_BOOLEAN:
                $this->value = (bool) $value;
                break;
            case self::TYPE_STRING:
                $this->value = (string) $value;
                break;
        }
        return $this;
    }
789610
public function persistent(bool $value = true): self
    {
        return $this->option(PDO::ATTR_PERSISTENT, $value);
    }
1106241
public function setValue($value) : self
    {
        if (is_bool($value)) {
            $value = ($value == true) ? '1' : '0';
        }

        $this->field->addAttribute('value', !is_null($value) ? (string) $value : '');

        return $this;
    }
417798
public function setChecked(bool $checked)
	{
		$this->value = $checked ? $this->getCheckedValue() : $this->getUncheckedValue();
		return $this;
	}
1155862
public function isDate() {
        $this->check_role = 'date';
        $result = false !== strtotime($this->value);
        $this->checkResult($result);
        return $this;
    }
1262417
public function setRequired(bool $required) : self
    {
        $required = (bool)$required;
        $this->required = $required;
        return $this;
    }
78820
public function required() {
        $this->check_role = 'require';
        $result = !empty($this->value) || '0' == $this->value;
        $this->checkResult($result);
        return $this;
    }
376823
public function withNoScript(bool $value = true) : self
    {
        $that = clone($this);
        $that->noScript = $value;
        return $that;
    }
615138
function delete()
    {

        if (!$this->exists()) {
            return false;
        }

        $this->newQuery()->id($this->getID())->delete();

        $this->exists = false;

        return $this;
    }
1005877
public function backup($is = true)
    {
        $is = (bool) $is;
        if ($this->backup === $is) {
            return $this;
        }
        $this->backup = $is;
        if ($this->backup) {
            $this->task->appendToBackupDrivers($this);
        } else {
            $this->task->removeFromBackupDrivers($this);
        }

        return $this;
    }
1040229
public function reverse($bool = true)
    {
        if ($bool) {
            $this->parameters['ScanIndexForward'] = false;
        } else {
            unset($this->parameters['ScanIndexForward']);
        }

        return $this;
    }
595564
public function body($value = false)
	{
		if (func_num_args())
		{
			$this->body = $value;
			return $this;
		}

		return $this->body;
	}
387857
public function toBool()
    {
        return (!is_null($this->returnValue)) &&
            (!empty($this->returnValue)) &&
            (!in_array(strtolower($this->returnValue), $this->falseStrings));
    }
318947
public function usePHPSession($bool = true)
    {
        if (!isset($_SESSION)) {
            session_start();
        }
        $this->_phpsession = $bool;
        return $this;
    }
826689
public function isChsAlpha() {
        $this->check_role = 'chsAlpha';
        $result = $this->checkRegex($this->value, '/^[\x{4e00}-\x{9fa5}a-zA-Z]+$/u');
        $this->checkResult($result);
        return $this;
    }