* Tous droits réservés. */ namespace Irstea\PlantUmlBundle\Model\Namespace_; use Irstea\PlantUmlBundle\Model\NamespaceInterface; use Irstea\PlantUmlBundle\Model\NodeInterface; use Irstea\PlantUmlBundle\Writer\WritableInterface; use Irstea\PlantUmlBundle\Writer\WriterInterface; /** * Description of Namespace * * @author Guillaume Perréal */ abstract class AbstractNamespace implements WritableInterface, NamespaceInterface { /** * @var NodeInterface[] */ private $nodes = []; /** * * @param NodeInterface $node */ public function addNode(NodeInterface $node) { $this->nodes[] = $node; return $this; } /** * @param WriterInterface $writer * @return self */ protected function writeNodesTo(WriterInterface $writer) { foreach ($this->nodes as $node) { $node->writeTo($writer); } return $this; } /** * @return bool */ protected function isEmpty() { return empty($this->nodes); } public function toConfig(array &$conf) { $conf['namespace'] = static::CONF_TYPE; } }