Code Duplication    Length = 10-11 lines in 2 locations

src/AbstractActiveRecord.php 2 locations

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