Code Duplication    Length = 10-11 lines in 2 locations

src/AbstractActiveRecord.php 2 locations

@@ 56-66 (lines=11) @@
53
	 *
54
	 * @return string the create query.
55
	 */
56
	private function getCreateQuery()
57
	{
58
		$columns = array_keys($this->getActiveRecordData());
59
		$values = [];
60
61
		foreach ($columns as $key => $value) {
62
			$values[] = ':' . $value;
63
		}
64
65
		return sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->getActiveRecordName(), implode(', ', $columns), implode(', ', $values));
66
	}
67
68
	/**
69
	 * {@inheritdoc}
@@ 114-123 (lines=10) @@
111
	 *
112
	 * @return string the update query.
113
	 */
114
	private function getUpdateQuery()
115
	{
116
		$values = [];
117
118
		foreach (array_keys($this->getActiveRecordData()) as $key => $value) {
119
			$values[] = $value . ' = :' . $value;
120
		}
121
122
		return sprintf('UPDATE %s SET %s WHERE `id` = :id', $this->getActiveRecordName(), implode(', ', $values));
123
	}
124
125
	/**
126
	 * {@inheritdoc}