src/Peach/DT/AbstractTime.php
private function getFieldIndex($field)
    {
        static $mapping = null;
        if (!isset($mapping)) {
            $mapping = array(
                "y"  => self::$YEAR,
                "mo" => self::$MONTH,
                "d"  => self::$DATE,
                "h"  => self::$HOUR,
                "m"  => self::$MINUTE,
                "s"  => self::$SECOND
            );
        }
        
        $field = strtolower($field);
        foreach ($mapping as $key => $index) {
            if (Strings::startsWith($field, $key)) {
                return $index;
            }
        }
        return -1;
    }
private function getFieldIndex($field)
    {
        static $mapping = null;
        if (!isset($mapping)) {
            $mapping = array(
                "y"  => self::$YEAR,
                "mo" => self::$MONTH,
                "d"  => self::$DATE,
                "h"  => self::$HOUR,
                "m"  => self::$MINUTE,
                "s"  => self::$SECOND
            );
        }
        
        $field = strtolower($field);
        foreach ($mapping as $key => $index) {
            if (Strings::startsWith($field, $key)) {
                return $index;
            }
        }
        return -1;
    }
指定されたフィールド名を $fields のインデックスに変換します.
不正なフィールド名の場合は -1 を返します.

@param  string $field フィールド名
@return int           インデックス

@see    Time::$YEAR
@see    Time::$MONTH
@see    Time::$DATE
@see    Time::$HOUR
@see    Time::$MINUTE
@see    Time::$SECOND
@codeCoverageIgnore