示例#1
0
 public function toArray()
 {
     $array = parent::toArray();
     $array['title'] = $this->getTitle();
     $array['level'] = $this->getLevel();
     return $array;
 }
 private function getImages(\JsonFormatContainerNode $containerNode, &$images)
 {
     foreach ($containerNode->getChildren() as $childNode) {
         $type = $childNode->getType();
         if ($type == 'section') {
             return;
         } else {
             if ($type == 'image' && !$childNode->isBlank()) {
                 /** @var \JsonFormatImageNode $childNode  */
                 $images[] = ["src" => $childNode->getSrc()];
             } else {
                 if ($type == 'imageFigure') {
                     /** @var \JsonFormatImageFigureNode $childNode  */
                     $images[] = ["src" => $childNode->getSrc(), "caption" => $childNode->getCaption()];
                 } else {
                     if ($type == 'paragraph') {
                         $this->getParagraphs($childNode, $paragraphs);
                     }
                 }
             }
         }
     }
 }