<?php
namespace phpDocumentor\Plugin\Scrybe\Converter\Metadata\TableOfContents;
abstract class BaseEntry
{
protected $parent = null;
protected $children = array();
protected $name = '';
public function __construct($parent = null)
{
$this->setParent($parent);
}
public function getParent()
{
return $this->parent;
}
public function setParent($parent)
{
if ($parent !== null && !$parent instanceof BaseEntry) {
throw new \InvalidArgumentException('An entry may only have another entry as parent');
}
$this->parent = $parent;
}
public function getChildren()
{
return $this->children;
}
public function addChild(BaseEntry $entry)
{
$this->children[] = $entry;
}
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
}