You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
794 B
41 lines
794 B
<?php
|
|
|
|
namespace App\Parser\DocxParser\Table;
|
|
|
|
use App\Parser\DocxParser\Traits\Helper;
|
|
use Illuminate\Support\Arr;
|
|
|
|
class Row
|
|
{
|
|
|
|
use Helper;
|
|
|
|
/**
|
|
* @param $row
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle($row)
|
|
{
|
|
$rows = $row->getCells();
|
|
$result = [];
|
|
foreach ($rows as $index => $cell) {
|
|
$handler = new Cell();
|
|
$result[] = $handler->handle($cell);
|
|
|
|
|
|
}
|
|
|
|
return [
|
|
'content' => '',
|
|
'children' => $result,
|
|
'depth' => null,
|
|
'height' => $row->getHeight(),
|
|
'isTblHeader' => $row->getStyle()->isTblHeader(),
|
|
'index' => $row->getElementIndex(),
|
|
'type' => 'row',
|
|
];
|
|
|
|
|
|
}
|
|
}
|