FetchMode.php 1.96 KB
Newer Older
1 2 3 4
<?php

namespace Doctrine\DBAL;

5 6
use PDO;

7 8
/**
 * Contains statement fetch modes.
9 10
 *
 * @deprecated Use one of the fetch- or iterate-related methods on the Statement.
11
 */
12
final class FetchMode
13 14 15 16 17 18 19 20 21
{
    /**
     * Specifies that the fetch method shall return each row as an array indexed
     * by column name as returned in the corresponding result set. If the result
     * set contains multiple columns with the same name, the statement returns
     * only a single value per column name.
     *
     * @see \PDO::FETCH_ASSOC
     */
22
    public const ASSOCIATIVE = PDO::FETCH_ASSOC;
23 24 25 26 27 28 29 30

    /**
     * Specifies that the fetch method shall return each row as an array indexed
     * by column number as returned in the corresponding result set, starting at
     * column 0.
     *
     * @see \PDO::FETCH_NUM
     */
31
    public const NUMERIC = PDO::FETCH_NUM;
32 33 34 35 36 37 38 39

    /**
     * Specifies that the fetch method shall return each row as an array indexed
     * by both column name and number as returned in the corresponding result set,
     * starting at column 0.
     *
     * @see \PDO::FETCH_BOTH
     */
40
    public const MIXED = PDO::FETCH_BOTH;
41 42 43 44 45 46 47 48

    /**
     * Specifies that the fetch method shall return each row as an object with
     * property names that correspond to the column names returned in the result
     * set.
     *
     * @see \PDO::FETCH_OBJ
     */
49
    public const STANDARD_OBJECT = PDO::FETCH_OBJ;
50 51 52 53 54 55 56

    /**
     * Specifies that the fetch method shall return only a single requested
     * column from the next row in the result set.
     *
     * @see \PDO::FETCH_COLUMN
     */
57
    public const COLUMN = PDO::FETCH_COLUMN;
58 59 60 61 62 63 64

    /**
     * Specifies that the fetch method shall return a new instance of the
     * requested class, mapping the columns to named properties in the class.
     *
     * @see \PDO::FETCH_CLASS
     */
65
    public const CUSTOM_OBJECT = PDO::FETCH_CLASS;
66 67 68 69

    /**
     * This class cannot be instantiated.
     */
70
    private function __construct()
71 72 73
    {
    }
}