/** * @param AbstractDbEntity $dbEntity * @return string */ protected function getPrimaryKeyWhereSql(AbstractDbEntity $dbEntity) { if (is_array($dbEntity->getPrimaryDbPropertyKey())) { $whereStrings = []; foreach ($dbEntity->getPrimaryDbPropertyKey() as $primaryKeyPart) { $whereStrings[] = '`' . $primaryKeyPart . '` = ?'; } $whereSql = implode(' AND ', $whereStrings); } else { $whereSql = '`' . $dbEntity->getPrimaryDbFieldKey() . '` = ?'; } return $whereSql; }