Code Duplication    Length = 12-12 lines in 2 locations

source/Spiral/ODM/Schemas/DocumentSchema.php 1 location

@@ 125-136 (lines=12) @@
122
     *
123
     * @return array
124
     */
125
    public function getFields(): array
126
    {
127
        $fields = $this->reflection->getFields();
128
129
        foreach ($fields as $field => $type) {
130
            if ($this->isAggregation($type)) {
131
                unset($fields[$field]);
132
            }
133
        }
134
135
        return $fields;
136
    }
137
138
    /**
139
     * {@inheritdoc}

source/Spiral/ORM/Schemas/RecordSchema.php 1 location

@@ 96-107 (lines=12) @@
93
     *
94
     * //todo: do we need it?
95
     */
96
    public function getFields(): array
97
    {
98
        $fields = $this->reflection->getFields();
99
100
        foreach ($fields as $field => $type) {
101
            if ($this->isRelation($type)) {
102
                unset($fields[$field]);
103
            }
104
        }
105
106
        return $fields;
107
    }
108
109
    /**
110
     * {@inheritdoc}