Code Duplication    Length = 3-3 lines in 3 locations

src/Queries/Mysql/ExtendedSelectionTrait.php 1 location

@@ 61-63 (lines=3) @@
58
        $table = $row->getTable();
59
        $scheme = $this->table->getScheme();
60
61
        if (!isset($scheme['relations'][$table->name])) {
62
            throw new SimpleCrudException(sprintf('The tables %s and %s are no related', $table->name, $this->table->name));
63
        }
64
65
        $relation = $scheme['relations'][$table->name];
66

src/Queries/Mysql/Select.php 2 locations

@@ 138-140 (lines=3) @@
135
    {
136
        $scheme = $this->table->getScheme();
137
138
        if (!isset($scheme['relations'][$table])) {
139
            throw new SimpleCrudException(sprintf("The tables '%s' and '%s' are not related", $this->table->name, $table));
140
        }
141
142
        if ($scheme['relations'][$table][0] !== Scheme::HAS_ONE) {
143
            throw new SimpleCrudException(sprintf("Invalid LEFT JOIN between the tables '%s' and '%s'", $this->table->name, $table));
@@ 142-144 (lines=3) @@
139
            throw new SimpleCrudException(sprintf("The tables '%s' and '%s' are not related", $this->table->name, $table));
140
        }
141
142
        if ($scheme['relations'][$table][0] !== Scheme::HAS_ONE) {
143
            throw new SimpleCrudException(sprintf("Invalid LEFT JOIN between the tables '%s' and '%s'", $this->table->name, $table));
144
        }
145
146
        $this->leftJoin[] = [
147
            'table' => $table,