function ToDBString($value)
    {
        if ($value === null)
            return $value;
        
        if ($this->IsRelatedObject($value))
            return $value->KeyValue();
        
        else if ($this->IsDatabaseObject($value))
            return $this->type->ToDBString($value);
        
        else if (!is_object($value) && !is_array($value))
            return (string)$value;
        
        throw new \InvalidArgumentException('Invalid argument for fieldmapper. Object could not be converted to database string.');
    }
function ToDBString($value)
    {
        if ($value === null)
            return $value;
        
        if ($this->IsRelatedObject($value))
            return $value->KeyValue();
        
        else if ($this->IsDatabaseObject($value))
            return $this->type->ToDBString($value);
        
        else if (!is_object($value) && !is_array($value))
            return (string)$value;
        
        throw new \InvalidArgumentException('Invalid argument for fieldmapper. Object could not be converted to database string.');
    }
function ToDBString ( $ value ) { if ( $ value === null ) return $ value ; if ( $ this -> IsRelatedObject ( $ value ) ) return $ value -> KeyValue ( ) ; else if ( $ this -> IsDatabaseObject ( $ value ) ) return $ this -> type -> ToDBString ( $ value ) ; else if ( ! is_object ( $ value ) && ! is_array ( $ value ) ) return ( string ) $ value ; throw new \ InvalidArgumentException ( 'Invalid argument for fieldmapper. Object could not be converted to database string.' ) ; }
Returns sql usable string or null for database NULL.
@param $value
@return string
Returns sql usable string or null for database NULL .