Code Duplication    Length = 13-13 lines in 2 locations

Moss/Storage/Query/AbstractEntityQuery.php 1 location

@@ 75-87 (lines=13) @@
72
     *
73
     * @throws QueryException
74
     */
75
    protected function setPrimaryKeyConditions()
76
    {
77
        foreach ($this->model->primaryFields() as $field) {
78
            $value = $this->accessor->getPropertyValue($this->instance, $field->name());
79
            $this->builder->andWhere(
80
                sprintf(
81
                    '%s = %s',
82
                    $this->connection->quoteIdentifier($field->mappedName()),
83
                    $this->builder->createNamedParameter($value, $field->type())
84
                )
85
            );
86
        }
87
    }
88
}
89

Moss/Storage/Query/UpdateQuery.php 1 location

@@ 70-82 (lines=13) @@
67
     *
68
     * @param FieldInterface $field
69
     */
70
    protected function assignValue(FieldInterface $field)
71
    {
72
        $value = $this->accessor->getPropertyValue($this->instance, $field->name());
73
74
        if ($value === null) {
75
            $this->getValueFromReferencedEntity($field);
76
        }
77
78
        $this->builder->set(
79
            $this->connection->quoteIdentifier($field->mappedName()),
80
            $this->builder->createNamedParameter($value, $field->type())
81
        );
82
    }
83
84
    /**
85
     * Executes query