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
817 B
41 lines
817 B
<?php
|
|
|
|
namespace App\Parser\DocxParser;
|
|
|
|
use App\Parser\DocxParser\Traits\Helper;
|
|
use Exception;
|
|
|
|
class Footnote
|
|
{
|
|
|
|
use Helper;
|
|
|
|
public function handle($section)
|
|
{
|
|
$result = [];
|
|
|
|
$sectionElements = $this->getElements($section);
|
|
foreach ($sectionElements as $element) {
|
|
try {
|
|
$handler = $this->getHandler($element);
|
|
} catch (Exception $e) {
|
|
throw new Exception($e->getMessage());
|
|
}
|
|
finally {
|
|
$data = $handler->handle($element);
|
|
if ($data) {
|
|
$result[] = $handler->handle($element);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
if (count($result) > 0) {
|
|
//dd($result);
|
|
return $result;
|
|
}
|
|
|
|
return;
|
|
}
|
|
}
|