Code Duplication    Length = 10-11 lines in 2 locations

src/AbstractActiveRecord.php 2 locations

@@ 61-71 (lines=11) @@
58
	 *
59
	 * @return string the create query.
60
	 */
61
	private function getCreateQuery()
62
	{
63
		$columns = array_keys($this->getActiveRecordData());
64
		$values = [];
65
66
		foreach ($columns as $key => $value) {
67
			$values[] = ':' . $value;
68
		}
69
70
		return sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->getActiveRecordName(), implode(', ', $columns), implode(', ', $values));
71
	}
72
73
	/**
74
	 * {@inheritdoc}
@@ 125-134 (lines=10) @@
122
	 *
123
	 * @return string the update query.
124
	 */
125
	private function getUpdateQuery()
126
	{
127
		$values = [];
128
129
		foreach (array_keys($this->getActiveRecordData()) as $key => $value) {
130
			$values[] = $value . ' = :' . $value;
131
		}
132
133
		return sprintf('UPDATE %s SET %s WHERE `id` = :id', $this->getActiveRecordName(), implode(', ', $values));
134
	}
135
136
	/**
137
	 * {@inheritdoc}