Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
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

  1. <?php
  2. namespace App\Parser\DocxParser\Table;
  3. use App\Parser\DocxParser\Traits\Helper;
  4. use Illuminate\Support\Arr;
  5. class Row
  6. {
  7. use Helper;
  8. /**
  9. * @param $row
  10. *
  11. * @return mixed
  12. */
  13. public function handle($row)
  14. {
  15. $rows = $row->getCells();
  16. $result = [];
  17. foreach ($rows as $index => $cell) {
  18. $handler = new Cell();
  19. $result[] = $handler->handle($cell);
  20. }
  21. return [
  22. 'content' => '',
  23. 'children' => $result,
  24. 'depth' => null,
  25. 'height' => $row->getHeight(),
  26. 'isTblHeader' => $row->getStyle()->isTblHeader(),
  27. 'index' => $row->getElementIndex(),
  28. 'type' => 'row',
  29. ];
  30. }
  31. }