snipe-it/app/Http/Transformers/DatatablesTransformer.php

15 lines
329 B
PHP
Raw Normal View History

2017-01-13 00:13:57 -08:00
<?php
2017-01-13 00:13:57 -08:00
namespace App\Http\Transformers;
class DatatablesTransformer
{
public function transformDatatables($objects, $total = null)
2017-01-13 00:13:57 -08:00
{
(isset($total)) ? $objects_array['total'] = $total : $objects_array['total'] = count($objects);
2017-01-13 00:13:57 -08:00
$objects_array['rows'] = $objects;
2017-01-13 00:13:57 -08:00
return $objects_array;
}
}