src/Leevel/Database/Ddd/Entity.php
protected function toArraySource(array $white = [], array $black = [], string $separate = ','): array
    {
        if ($white || $black) {
            $prop = $this->whiteAndBlack(
                $this->fields(), $white, $black
            );
        } else {
            $prop = $this->normalizeWhiteAndBlack(
                $this->fields(), 'show_prop'
            );
        }

        $result = [];

        foreach ($prop as $k => $value) {
            if ($this->isRelation($k)) {
                continue;
            }

            $value = $this->propValue($k);
            $result[$k] = $value;

            $result = static::prepareEnum($k, $result, $separate);
        }

        return $result;
    }
protected function toArraySource(array $white = [], array $black = [], string $separate = ','): array
    {
        if ($white || $black) {
            $prop = $this->whiteAndBlack(
                $this->fields(), $white, $black
            );
        } else {
            $prop = $this->normalizeWhiteAndBlack(
                $this->fields(), 'show_prop'
            );
        }

        $result = [];

        foreach ($prop as $k => $value) {
            if ($this->isRelation($k)) {
                continue;
            }

            $value = $this->propValue($k);
            $result[$k] = $value;

            $result = static::prepareEnum($k, $result, $separate);
        }

        return $result;
    }
对象转数组.

@return array