/** * Constructor * * @param string $name * @param int $mode mode in octal (0XXX) * @return void **/ public function __construct($name, $mode = null) { parent::__construct($name); $this->setMode($mode); }
/** * Constructor * * @param string $from endpoint (what the link points to) * @param string $to used as $name for Node * @return void **/ public function __construct($from, $to) { parent::__construct($to); $this->setEndpoint($from); }
/** * Add a child * * @param Node $child * @return Directory **/ public function addChild(Node $child) { $child->setParent($this); $this->children[] = $child; return $this; }
/** * Get the full path to a node, including the root path * * @see getRoot() * * @param Node $node * @return string **/ private function getNodePath(Node $node) { return $this->getRoot() . DIRECTORY_SEPARATOR . trim($node->getFullName(DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR); }