public static function getFromPDO(array $p_pdo_description)
    {
        $me = self::getNew();
        if (is_array($p_pdo_description)) {
            if (array_key_exists('name', $p_pdo_description)) {
                $me->setFldName($p_pdo_description['name']);
            }
            if (array_key_exists('len', $p_pdo_description)) {
                $me->setFldLength($p_pdo_description['len']);
            }
            if (array_key_exists('precision', $p_pdo_description)) {
                $me->setFldComplement($p_pdo_description['precision']);
            }
            $me->setFldType(FFCST::TYPE_STRING);
            if (array_key_exists('native_type', $p_pdo_description)) {
                switch (strtoupper($p_pdo_description['native_type'])) {
                    case 'LONGLONG':
                        $me->setFldType(FFCST::TYPE_BIGINT);
                        break;
                    case 'TINY':
                        $me->setFldType(FFCST::TYPE_INTEGER);
                        break;
                    case 'BLOB':
                        $me->setFldType(FFCST::TYPE_BLOB);
                        break;
                    case 'TIMESTAMP':
                        $me->setFldType(FFCST::TYPE_DATETIME);
                        break;
                }
            }
            if (array_key_exists('flags', $p_pdo_description)) {
                if (is_array($p_pdo_description['flags'])) {
                    foreach ($p_pdo_description['flags'] as $idx => $flag) {
                        if ($flag == 'primary_key') {
                            $me->setFldPrimary(true);
                        }
                        if ($flag == 'not_null') {
                            $me->setFldRequired(true);
                        }
                    }
                }
            }
        }
        return $me;
    }
public static function getFromPDO(array $p_pdo_description)
    {
        $me = self::getNew();
        if (is_array($p_pdo_description)) {
            if (array_key_exists('name', $p_pdo_description)) {
                $me->setFldName($p_pdo_description['name']);
            }
            if (array_key_exists('len', $p_pdo_description)) {
                $me->setFldLength($p_pdo_description['len']);
            }
            if (array_key_exists('precision', $p_pdo_description)) {
                $me->setFldComplement($p_pdo_description['precision']);
            }
            $me->setFldType(FFCST::TYPE_STRING);
            if (array_key_exists('native_type', $p_pdo_description)) {
                switch (strtoupper($p_pdo_description['native_type'])) {
                    case 'LONGLONG':
                        $me->setFldType(FFCST::TYPE_BIGINT);
                        break;
                    case 'TINY':
                        $me->setFldType(FFCST::TYPE_INTEGER);
                        break;
                    case 'BLOB':
                        $me->setFldType(FFCST::TYPE_BLOB);
                        break;
                    case 'TIMESTAMP':
                        $me->setFldType(FFCST::TYPE_DATETIME);
                        break;
                }
            }
            if (array_key_exists('flags', $p_pdo_description)) {
                if (is_array($p_pdo_description['flags'])) {
                    foreach ($p_pdo_description['flags'] as $idx => $flag) {
                        if ($flag == 'primary_key') {
                            $me->setFldPrimary(true);
                        }
                        if ($flag == 'not_null') {
                            $me->setFldRequired(true);
                        }
                    }
                }
            }
        }
        return $me;
    }
public static function getFromPDO ( array $ p_pdo_description ) { $ me = self :: getNew ( ) ; if ( is_array ( $ p_pdo_description ) ) { if ( array_key_exists ( 'name' , $ p_pdo_description ) ) { $ me -> setFldName ( $ p_pdo_description [ 'name' ] ) ; } if ( array_key_exists ( 'len' , $ p_pdo_description ) ) { $ me -> setFldLength ( $ p_pdo_description [ 'len' ] ) ; } if ( array_key_exists ( 'precision' , $ p_pdo_description ) ) { $ me -> setFldComplement ( $ p_pdo_description [ 'precision' ] ) ; } $ me -> setFldType ( FFCST :: TYPE_STRING ) ; if ( array_key_exists ( 'native_type' , $ p_pdo_description ) ) { switch ( strtoupper ( $ p_pdo_description [ 'native_type' ] ) ) { case 'LONGLONG' : $ me -> setFldType ( FFCST :: TYPE_BIGINT ) ; break ; case 'TINY' : $ me -> setFldType ( FFCST :: TYPE_INTEGER ) ; break ; case 'BLOB' : $ me -> setFldType ( FFCST :: TYPE_BLOB ) ; break ; case 'TIMESTAMP' : $ me -> setFldType ( FFCST :: TYPE_DATETIME ) ; break ; } } if ( array_key_exists ( 'flags' , $ p_pdo_description ) ) { if ( is_array ( $ p_pdo_description [ 'flags' ] ) ) { foreach ( $ p_pdo_description [ 'flags' ] as $ idx => $ flag ) { if ( $ flag == 'primary_key' ) { $ me -> setFldPrimary ( true ) ; } if ( $ flag == 'not_null' ) { $ me -> setFldRequired ( true ) ; } } } } } return $ me ; }
Get new from pdo metadatas

@param array $p_pdo_description

@return \FreeFW\Model\Field
Get new from pdo metadatas