Skip to content

Commit d52c897

Browse files
committed
Add \XBase\Record::getChoppedData, refactor \XBase\Record::getData
1 parent 974ae34 commit d52c897

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/XBase/Record.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,12 +652,30 @@ public function serializeRawData()
652652
}
653653

654654
/**
655+
* Returns typed column values according to their types
656+
*
655657
* @return array
656658
*/
657659
public function getData()
658660
{
659661
$fields = array();
660662

663+
foreach ($this->getColumns() as $column) {
664+
$fields[$column->name] = $this->getObject($column);
665+
}
666+
667+
return $fields;
668+
}
669+
670+
/**
671+
* Returns raw values trimmed and converted according to encoding
672+
*
673+
* @return array|string[]
674+
*/
675+
public function getChoppedData()
676+
{
677+
$fields = array();
678+
661679
foreach ($this->choppedData as $columnName => $columnValue) {
662680
$fields[$columnName] = $this->forceGetString($columnName);
663681
}

0 commit comments

Comments
 (0)