/**
* Method to get an object containing all of the table columns and values.
*
* @param TableInterface $table Table object.
*
* @return \stdClass Contains all of the columns and values.
*
* @since 3.2
*/
public function getDataObject(TableInterface $table)
{
$fields = $table->getFields();
$dataObject = new \stdClass();
foreach ($fields as $field) {
$fieldName = $field->Field;
$dataObject->{$fieldName} = $table->get($fieldName);
}
return $dataObject;
}