src/Node/Node.php
public function toArray(array $options = [])
    {
        $childrenIds = [];

        /** @var NodeInterface $child */
        foreach ($this->getChildren() as $child) {
            $childrenIds[] = $child->getId();
        }

        return [
            'id'                => $this->getId(),
            'name'              => $this->getName(),
            'type'              => $this->getType(),
            'metadata'          => $this->getMetadata()->getData(),
            'parentId'          => $this->getParent() ?
                $this->getParent()->getId() :
                null,
            'childrenIds'       => $childrenIds
        ];
    }
public function toArray(array $options = [])
    {
        $childrenIds = [];

        /** @var NodeInterface $child */
        foreach ($this->getChildren() as $child) {
            $childrenIds[] = $child->getId();
        }

        return [
            'id'                => $this->getId(),
            'name'              => $this->getName(),
            'type'              => $this->getType(),
            'metadata'          => $this->getMetadata()->getData(),
            'parentId'          => $this->getParent() ?
                $this->getParent()->getId() :
                null,
            'childrenIds'       => $childrenIds
        ];
    }
public function toArray ( array $ options = [ ] ) { $ childrenIds = [ ] ; /** @var NodeInterface $child */ foreach ( $ this -> getChildren ( ) as $ child ) { $ childrenIds [ ] = $ child -> getId ( ) ; } return [ 'id' => $ this -> getId ( ) , 'name' => $ this -> getName ( ) , 'type' => $ this -> getType ( ) , 'metadata' => $ this -> getMetadata ( ) -> getData ( ) , 'parentId' => $ this -> getParent ( ) ? $ this -> getParent ( ) -> getId ( ) : null , 'childrenIds' => $ childrenIds ] ; }
Returns an array representation of this node.

@param array $options - Options.

@return array
Returns an array representation of this node .