Page 1 of 1

ColumnCount not implemented

PostPosted: October 21st, 2014, 8:31 pm
by davidbcn
PDOStatement class in PHP has a ColumnCount method.

http://php.net/manual/es/pdostatement.columncount.php

This is not implement in Phalanger's PDO extension.

Greetings,

Re: ColumnCount not implemented

PostPosted: October 21st, 2014, 8:39 pm
by davidbcn
This made the trick, I'm not sure if the implementation is right.

#region columnCount
[PhpVisible, ImplementsMethod]
public virtual object columnCount(ScriptContext context)
{
if (this.CurrentReader != null)
{
return this.CurrentReader.FieldCount;
}
return -1;
}

[EditorBrowsable(EditorBrowsableState.Never)]
public static object columnCount(object instance, PhpStack stack)
{
stack.RemoveFrame();
return ((PDOStatement)instance).columnCount(stack.Context);
}
#endregion

Re: ColumnCount not implemented

PostPosted: October 30th, 2014, 10:23 am
by Jakub Misek
sorry for the delay.

It looks great, I can merge it into sources and push it on github.

Thanks,