FetchMode.php 1.79 KB
Newer Older
1 2 3 4 5 6 7
<?php

namespace Doctrine\DBAL;

/**
 * Contains statement fetch modes.
 */
8
final class FetchMode
9 10 11 12 13 14 15 16 17
{
    /**
     * 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
     */
18
    public const ASSOCIATIVE = 2;
19 20 21 22 23 24 25 26

    /**
     * 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
     */
27
    public const NUMERIC = 3;
28 29 30 31 32 33 34 35

    /**
     * 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
     */
36
    public const MIXED = 4;
37 38 39 40 41 42 43 44

    /**
     * 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
     */
45
    public const STANDARD_OBJECT = 5;
46 47 48 49 50 51 52

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

    /**
     * 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
     */
61
    public const CUSTOM_OBJECT = 8;
62 63 64 65

    /**
     * This class cannot be instantiated.
     */
66
    private function __construct()
67 68 69
    {
    }
}