Declares an association between this object and a ChildStructureNode object.

@param  ChildStructureNode $v
@return $this|\gossi\trixionary\model\StructureNodeParent The current object (for fluent API support)
@throws PropelException
551142
public function setStructureNodeRelatedByStructureNodeId(ChildStructureNode $v = null)
    {
        if ($v === null) {
            $this->setStructureNodeId(NULL);
        } else {
            $this->setStructureNodeId($v->getId());
        }

        $this->aStructureNodeRelatedByStructureNodeId = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildStructureNode object, it will not be re-added.
        if ($v !== null) {
            $v->addStructureNodeParentRelatedByStructureNodeId($this);
        }


        return $this;
    }
1360361
public function setAncestor(ChildSkill $v = null)
    {
        if ($v === null) {
            $this->setAncestorId(NULL);
        } else {
            $this->setAncestorId($v->getId());
        }

        $this->aAncestor = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildSkill object, it will not be re-added.
        if ($v !== null) {
            $v->addLineageRelatedByAncestorId($this);
        }


        return $this;
    }
325717
public function setCustomer(ChildCustomer $v = null)
    {
        if ($v === null) {
            $this->setCustomerId(NULL);
        } else {
            $this->setCustomerId($v->getId());
        }

        $this->aCustomer = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildCustomer object, it will not be re-added.
        if ($v !== null) {
            $v->addCustomerCustomerGroup($this);
        }


        return $this;
    }
337372
public function setMap(ChildMap $v = null)
    {
        if ($v === null) {
            $this->setTrackuid(NULL);
        } else {
            $this->setTrackuid($v->getMapuid());
        }

        $this->aMap = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildMap object, it will not be re-added.
        if ($v !== null) {
            $v->addMxmap($this);
        }


        return $this;
    }
1355117
public function setSkill(ChildSkill $v = null)
    {
        if ($v === null) {
            $this->setId(NULL);
        } else {
            $this->setId($v->getId());
        }

        $this->aSkill = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildSkill object, it will not be re-added.
        if ($v !== null) {
            $v->addSkillVersion($this);
        }


        return $this;
    }
569737
public function setIndexEngineIndex(ChildIndexEngineIndex $v = null)
    {
        if ($v === null) {
            $this->setId(null);
        } else {
            $this->setId($v->getId());
        }

        $this->aIndexEngineIndex = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildIndexEngineIndex object, it will not be re-added.
        if ($v !== null) {
            $v->addIndexEngineIndexVersion($this);
        }

        return $this;
    }
102922
private function appendNode(ElementtypeStructure $structure, ElementtypeStructureNode $node, Element $element)
    {
        $nodeAttributes = [
            'type' => $node->getType(),
            'dsId' => $node->getDsId(),
            'name' => $node->getName(),
        ];
        if ($node->getReferenceElementtypeId()) {
            $nodeAttributes['referenceElementtypeId'] = $node->getReferenceElementtypeId();
        }

        $nodeElement = $element->appendElement('node', '', $nodeAttributes);

        $labels = $node->getLabels();
        if ($labels) {
            foreach ($labels as $key => $value) {
                foreach ($value as $language => $languageValue) {
                    if (!$languageValue) {
                        unset($labels[$key][$language]);
                    }
                }
            }
            if ($labels) {
                $labelsElement = $nodeElement->appendElement('labels');
                foreach ($labels as $key => $value) {
                    foreach ($value as $language => $languageValue) {
                        $labelsElement->appendElement(
                            'label',
                            $languageValue,
                            [
                                'type' => $key,
                                'language' => $language,
                            ]
                        );
                    }
                }
            }
        }

        $configuration = $node->getConfiguration();
        if ($configuration) {
            foreach ($configuration as $key => $value) {
                if (!$value) {
                    unset($configuration[$key]);
                }
            }
            if ($configuration) {
                $configurationElement = $nodeElement->appendElement('configuration');
                foreach ($configuration as $key => $value) {
                    $attributes = [
                        'key' => $key,
                        'type' => gettype($value),
                    ];
                    if (is_array($value)) {
                        $value = json_encode($value);
                        $attributes['type'] = 'json_array';
                    } elseif (!is_scalar($value)) {
                        throw new InvalidArgumentException('Value has to be array or scalar.');
                    }
                    $configurationElement->appendElement(
                        'item',
                        $value,
                        $attributes
                    );
                }
            }
        }

        $validation = $node->getValidation();
        if ($validation) {
            foreach ($validation as $key => $value) {
                if (!$value) {
                    unset($validation[$key]);
                }
            }
            if ($validation) {
                $validationElement = $nodeElement->appendElement('validation');
                foreach ($validation as $key => $value) {
                    $validationElement->appendElement(
                        'constraint',
                        $value,
                        [
                            'key' => $key,
                        ]
                    );
                }
            }
        }

        $childNodes = $structure->getChildNodes($node->getDsId());
        if ($childNodes) {
            $childrenElement = $nodeElement->appendElement('children');
            foreach ($childNodes as $childNode) {
                $this->appendNode($structure, $childNode, $childrenElement);
            }
        }

        return $nodeElement;
    }
1245659
public function setTeam(ChildTeam $v = null)
    {
        if ($v === null) {
            $this->setTeamId(NULL);
        } else {
            $this->setTeamId($v->getId());
        }

        $this->aTeam = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildTeam object, it will not be re-added.
        if ($v !== null) {
            $v->addPersonTeamLink($this);
        }


        return $this;
    }
441169
public function setPage(ChildPage $v = null)
    {
        if ($v === null) {
            $this->setPageId(NULL);
        } else {
            $this->setPageId($v->getId());
        }

        $this->aPage = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildPage object, it will not be re-added.
        if ($v !== null) {
            $v->addM2P($this);
        }


        return $this;
    }
1204973
public function inherits(RowStructure $structure)
    {
        foreach ($structure->getDefinition() as $field => $type) {
            $this->addField($field, $type);
        }

        return $this;
    }
1069825
public function setProduct(ChildProduct $v = null)
    {
        if ($v === null) {
            $this->setProductId(NULL);
        } else {
            $this->setProductId($v->getId());
        }

        $this->aProduct = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildProduct object, it will not be re-added.
        if ($v !== null) {
            $v->addDealerProduct($this);
        }


        return $this;
    }
753367
public function setFeatureAv(ChildFeatureAv $v = null)
    {
        if ($v === null) {
            $this->setFeatureAvId(NULL);
        } else {
            $this->setFeatureAvId($v->getId());
        }

        $this->aFeatureAv = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildFeatureAv object, it will not be re-added.
        if ($v !== null) {
            $v->addFeatureTypeAvMeta($this);
        }


        return $this;
    }
1182754
public function setDealerProduct(ChildDealerProduct $v = null)
    {
        if ($v === null) {
            $this->setId(NULL);
        } else {
            $this->setId($v->getId());
        }

        $this->aDealerProduct = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildDealerProduct object, it will not be re-added.
        if ($v !== null) {
            $v->addDealerProductVersion($this);
        }


        return $this;
    }
1024140
public function setReference(ChildReference $v = null)
    {
        if ($v === null) {
            $this->setReferenceId(NULL);
        } else {
            $this->setReferenceId($v->getId());
        }

        $this->aReference = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildReference object, it will not be re-added.
        if ($v !== null) {
            $v->addVideo($this);
        }


        return $this;
    }
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;
    }
755192
public function setTreeLevel($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->tree_level !== $v) {
            $this->tree_level = $v;
            $this->modifiedColumns[CategoryTableMap::COL_TREE_LEVEL] = true;
        }

        return $this;
    }
540497
public function setSkillRelatedByPartId(ChildSkill $v = null)
    {
        if ($v === null) {
            $this->setPartId(NULL);
        } else {
            $this->setPartId($v->getId());
        }

        $this->aSkillRelatedByPartId = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildSkill object, it will not be re-added.
        if ($v !== null) {
            $v->addPart($this);
        }


        return $this;
    }