Associate a ChildStructureNode to this object
through the kk_trixionary_structure_node_parent cross reference table.

@param ChildStructureNode $structureNodeRelatedByStructureNodeId
@return ChildStructureNode The current object (for fluent API support)
770724
public function addStructureNodeRelatedByStructureNodeId(ChildStructureNode $structureNodeRelatedByStructureNodeId)
    {
        if ($this->collStructureNodesRelatedByStructureNodeId === null) {
            $this->initStructureNodesRelatedByStructureNodeId();
        }

        if (!$this->getStructureNodesRelatedByStructureNodeId()->contains($structureNodeRelatedByStructureNodeId)) {
            // only add it if the **same** object is not already associated
            $this->collStructureNodesRelatedByStructureNodeId->push($structureNodeRelatedByStructureNodeId);
            $this->doAddStructureNodeRelatedByStructureNodeId($structureNodeRelatedByStructureNodeId);
        }

        return $this;
    }
112709
public function update($structureID = 0)
    {
        // Fill the fields from $_POST array
        foreach ($_POST as $key => $val) {
            $this[$key]=$val;
        }

        $this->save();
        /** @var \samson\cms\web\navigation\CMSNav $cmsnav */

        // If isset current structure
        if (dbQuery('\samson\cms\web\navigation\CMSNav')->id($structureID)->first($cmsnav)) {

            // If structure has not relation with current field
            if (!dbQuery('structurefield')->StructureID($cmsnav->id)->FieldID($this->id)->first()) {

                // Create new relation between structure and field
                $strField = new \samson\activerecord\structurefield(false);
                $strField->FieldID = $this->id;
                $strField->StructureID = $cmsnav->id;
                $strField->Active = 1;

                // Save relation
                $strField->save();
            }
        }
    }
126987
public function removeChildNode(NodeInterface $childNode){
        $this->childNodes = array_filter($this->childNodes, function($node) use ($childNode){
            return $node !== $childNode;
        });
        return $this;
    }
877091
public function setStructureNodeId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->structure_node_id !== $v) {
            $this->structure_node_id = $v;
            $this->modifiedColumns[StructureNodeParentTableMap::COL_STRUCTURE_NODE_ID] = true;
        }

        if ($this->aStructureNodeRelatedByStructureNodeId !== null && $this->aStructureNodeRelatedByStructureNodeId->getId() !== $v) {
            $this->aStructureNodeRelatedByStructureNodeId = null;
        }

        return $this;
    }
690461
protected function documentToStructure(StructureBehavior $document)
    {
        return new $this(
            $this->inspector->getStructureMetadata($document),
            $this->inspector,
            $this->propertyFactory,
            $document
        );
    }
80398
public function loadNode($nodeId, $type = null)
    {
        if (is_null($type)) {
            $node = $this->registry->getRepository('ClasticNodeBundle:Node')
                ->find($nodeId);
            $type = $node->getType();
        }

        return $this->registry
            ->getRepository($this->getEntityName($type))
            ->findOneBy(array('node' => $nodeId));
    }
1101874
public function getParentNode($dsId)
    {
        $parentDsId = $this->getParentDsId($dsId);

        if (null === $parentDsId) {
            return null;
        }

        return $this->dsIdMap[$parentDsId];
    }
986876
protected function getForm( StructureInterface $structure )
    {
        /* @var $form \Zend\Form\Form */
        /* @var $type \Zend\Form\Form */
        $service = $this->getServiceLocator()
                        ->get( 'Form' );
        $form    = $service->create( 'Grid\Menu\Meta\Base' );
        $meta    = $service->get( 'Grid\Menu\Meta\Type' );
        $type    = $structure->getType();

        if ( $meta->has( $type ) )
        {
            foreach ( $meta->get( $type ) as $element )
            {
                $form->add( clone $element );
            }
        }

        $form->add( array(
            'type'  => 'Zork\Form\Element\Submit',
            'name'  => 'save',
            'attributes' => array(
                'value'  => 'menu.form.submit',
            ),
        ) );

        $form->setHydrator( $this->getModel()->getMapper() )
             ->bind( $structure );

        return $form;
    }
450082
private function loadStructure(Document $dom)
    {
        $elementtypeStructure = new ElementtypeStructure();

        $nodes = $dom->documentElement->evaluate('structure/node');
        if ($nodes->length) {
            foreach ($nodes as $node) {
                $this->loadNode($node, $elementtypeStructure);
            }
        }

        return $elementtypeStructure;
    }
110681
protected function isStructureNode($refEntityName)
    {
        $structureNode = false;
        if (class_exists($refEntityName)) {
            $page = new $refEntityName();
            $structureNode = ($page instanceof StructureNode);
            unset($page);
        }

        return $structureNode;
    }
4331
public function createStructure($structure)
    {
        vfsStream::create($this->prepareStructure($structure), $this->getRoot());

        return $this->getRootPath();
    }
507353
public function delete( $structureOrPrimaryKeys )
    {
        if ( is_object( $structureOrPrimaryKeys ) )
        {
            $id = $structureOrPrimaryKeys->paragraph->id;
        }
        else if ( is_array( $structureOrPrimaryKeys ) )
        {
            if ( isset( $structureOrPrimaryKeys['paragraph']['id'] ) )
            {
                $id = $structureOrPrimaryKeys['paragraph']['id'];
            }
            else
            {
                $id = reset( $structureOrPrimaryKeys );
            }
        }
        else
        {
            $id = $structureOrPrimaryKeys;
        }

        return $this->getParagraphMapper()
                    ->delete( $id );
    }
805725
public function setPageStructure(array $structure)
    {
        foreach ($structure as $_ref) {
            HtmlHelper::getNewId($_ref, true);
        }
        $this->registry->setEntry('page_structure', $structure);
        return $this;
    }
11564
public function getParentNode()
    {
        if (!$this->parentNode) {
            throw new \RuntimeException(sprintf(
                'Trying to retrieve parent node when no parent node has been set. An event ' .
                'listener should have set the node when persisting document "%s"',
                DocumentHelper::getDebugTitle($this->document)
            ));
        }

        return $this->parentNode;
    }
710132
public function prune($structureNodeParent = null)
    {
        if ($structureNodeParent) {
            $this->addCond('pruneCond0', $this->getAliasedColName(StructureNodeParentTableMap::COL_STRUCTURE_NODE_ID), $structureNodeParent->getStructureNodeId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(StructureNodeParentTableMap::COL_PARENT_ID), $structureNodeParent->getParentId(), Criteria::NOT_EQUAL);
            $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
        }

        return $this;
    }
29648
public function whereParentIs(ResourceNode $parent)
    {
        $this->addWhereClause('node.parent = :ar_parentId');
        $this->parameters[':ar_parentId'] = $parent->getId();

        return $this;
    }
1088846
public function removeChildNode(NodeInterface $childNode){
        $deleteIndex = -1;
        $idx=0;
        foreach($this->_childNodes as $child){
            if($child->getIdentifier() == $childNode->getIdentifier()){
                $deleteIndex = $idx;
                break;
            }
            $idx++;
        }
        if($deleteIndex != -1){
            unset($this->_childNodes[$deleteIndex]);
            $this->_childNodes = array_values($this->_childNodes);
        }
        return $this;
    }