/**
* Converts a core lib Cell to a TS PB Cell
*
* @param Cell $cell
* @return TsCell
*/
public static function toPbCell(Cell $cell)
{
$tsCell = new TsCell();
switch ($cell->getType()) {
case Cell::INT_TYPE:
$tsCell->setSint64Value($cell->getValue());
break;
case Cell::DOUBLE_TYPE:
$tsCell->setDoubleValue($cell->getValue());
break;
case Cell::TIMESTAMP_TYPE:
$tsCell->setTimestampValue($cell->getValue());
break;
case Cell::BOOL_TYPE:
$tsCell->setBooleanValue($cell->getValue());
break;
case Cell::BLOB_TYPE:
if (is_null($cell->getValue())) {
$tsCell->setVarcharValue('');
break;
}
default:
$tsCell->setVarcharValue($cell->getValue());
}
return $tsCell;
}