2014-04-15 09:40:07 -04:00
|
|
|
<?php
|
2026-03-26 12:46:27 -04:00
|
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2014-04-15 09:40:07 -04:00
|
|
|
|
|
|
|
|
namespace Icinga\Data;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Interface for retrieving data
|
|
|
|
|
*/
|
|
|
|
|
interface Fetchable
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve an array containing all rows of the result set
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function fetchAll();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fetch the first row of the result set
|
|
|
|
|
*
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
public function fetchRow();
|
|
|
|
|
|
|
|
|
|
/**
|
2015-05-19 03:48:20 -04:00
|
|
|
* Fetch the first column of all rows of the result set as an array
|
2014-04-15 09:40:07 -04:00
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
2015-05-19 03:48:20 -04:00
|
|
|
public function fetchColumn();
|
2014-04-15 09:40:07 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fetch the first column of the first row of the result set
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function fetchOne();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fetch all rows of the result set as an array of key-value pairs
|
|
|
|
|
*
|
|
|
|
|
* The first column is the key, the second column is the value.
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function fetchPairs();
|
|
|
|
|
}
|