Set a parent

@param  object $parent
@return HelperAbstract
@throws WrongParent
161791
public function setParent($parent) {
		if (! is_object($parent)) {
			throw new WrongParent('Parent of a helper must be an object, "' . gettype($parent) . '" was given');
		}
		
		$this->_parent = $parent;
		
		return $this;
	}
147282
public function AddParent($parent)
    {
        $parent = str_replace("::", "\\", $parent);
        
        $this->parents[$parent] = $parent;
        $this->has_parent = true;
        
        return $this;
    }
1248937
public function setParent(Page $parent)
    {
        $this->parent = $parent;

        $this->parentId = $parent->getPageId();
    }
677128
public function setParent(&$parent)
	{
		JLog::add('JNode::setParent() is deprecated.', JLog::WARNING, 'deprecated');

		if ($parent instanceof JNode || is_null($parent))
		{
			$hash = spl_object_hash($this);

			if (!is_null($this->_parent))
			{
				unset($this->_parent->children[$hash]);
			}

			if (!is_null($parent))
			{
				$parent->_children[$hash] = & $this;
			}

			$this->_parent = & $parent;
		}
	}
645177
public function setParent(\Octopouce\AdminBundle\Entity\Category $parent = null)
    {
        $this->parent = $parent;

        return $this;
    }
1304476
public function setParent(\Wucdbm\Bundle\MenuBuilderBundle\Entity\MenuItem $parent = null) {
        $this->parent = $parent;

        return $this;
    }
582244
public function bindParent($parent, $parentPropertyName=NULL)
	{
		$this->_parent = $parent;
		$this->_parentPropertyName = $parentPropertyName;
		return $this;
	}
969161
public function setParent(LeafRole $parent = null)
    {
        if ($parent && !$parent->getChildren()->contains($this)) {
            $parent->addChild($this);
        }
        $this->parent = $parent;

        return $this;
    }
449956
public function setParent($parent)
    {
        if (!empty($parent)) {
            $this->_parent = $this->_normalizeClass($parent);
        } else {
            $this->_parent = null;
        }

        return $this;
    }
365675
public function setParent(Profile $parent)
  {
    // Ensure parent doesn't already have this profile loaded.
    // This prevents recursive looping.
    if (!$parent->getParent($this->getName())) {
      $this->parent = $parent;
      return $this;
    }
    throw new \Exception($this->getName() . ' already found in profile lineage.');
  }
1312390
public function setParent(\Haven\CoreBundle\Entity\Category $parent = null) {
        $this->parent = $parent;

        return $this;
    }
1066588
public function setParentId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

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

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

        return $this;
    }
238728
public function setParentId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->parent_id !== $v) {
            $this->parent_id = $v;
            $this->modifiedColumns[SkillDependencyTableMap::COL_PARENT_ID] = true;
        }

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

        return $this;
    }
709433
public function decorate($parent)
	{
		$this->_parent = $parent;

		// Lock down attributes to what is defined in the class
		// and speed up references in magic methods

		$class_name = get_class($parent);

		if ( ! isset(self::$_reflections[$class_name]))
		{
			$r = new ReflectionObject($parent);

			foreach ($r->getMethods() as $method)
			{
				if ($method->isPublic())
				{
					$this->_methods[] = $method->getName();
				}
			}

			foreach ($r->getProperties() as $prop)
			{
				if ($prop->isPublic())
				{
					$this->_properties[] = $prop->getName();
				}
			}

			self::$_reflections[$class_name] = array($this->_methods, $this->_properties);
		}
		else
		{
			list($this->_methods, $this->_properties) = self::$_reflections[$class_name];
		}
	}
946154
public function setParentThing(ThingInterface $parentThing)
    {
        // If the new parent thing differs from the current one
        if ($this->parentThing !== $parentThing) {
            $context = clone $this;
            $context->parentThing = $parentThing;
            return $context;
        }

        return $this;
    }
240315
public function setParent(\Haven\CoreBundle\Entity\ExternalLink $parent = null)
    {
        $this->parent = $parent;
    
        return $this;
    }
125443
public function setParent(FilterBuilderWithChildren $parent)
    {
        if ($this->parent && $this->parent !== $parent) {
            $this->parent->remove($this);
        }

        $this->parent = $parent;
        $this->parent->add($this);

        return $this;
    }