Piotr Labudda %!s(int64=8) %!d(string=hai) anos
pai
achega
daeaa1ae80
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      SE/se-lib/Core/Pdo.php

+ 6 - 0
SE/se-lib/Core/Pdo.php

@@ -433,6 +433,12 @@ EOF_STRUCT_MYSQL;
 		return $sth->fetchColumn();
 	}
 
+	public function fetchValuesList($sql, $values = []) { // for sql like `select ID from ...` @returns array of ID
+		return array_map(function ($row) {
+			return reset($row);
+		}, $this->fetchAll($sql, $values));
+	}
+
 	public function fetchFirst($sql, $values = []) { // fetch only first row
 		$sth = $this->prepare($sql);
 		if (!empty($values)) {