/** * Makes a node type mutation * * @param mixed $value * @return Media */ protected function makeNodeTypeMutation($value) { return node_bag($value); }
/** * Gets the full url for node * * @param string $locale * @return string */ public function getSiteURL($locale = null) { $node = $this; $uri = ''; do { $uri = '/' . $node->getTranslationAttribute('node_name', $locale) . $uri; $node = is_null($node->parent_id) ? null : node_bag($node->parent_id, false); } while (!is_null($node) && $node->home != '1'); return url($uri); }
/** @test */ function it_registers_nodebag_helper() { $this->assertInstanceOf('Nuclear\\Hierarchy\\NodeBag', node_bag()); $this->assertNull(node_bag(1337)); }