Newscoop\NewscoopBundle\Entity\Topic::setParent PHP Метод

setParent() публичный Метод

Sets the value of parent.
public setParent ( mixed $parent = null ) : self
$parent mixed the parent
Результат self
    public function setParent($parent = null)
    {
        $this->parent = $parent;
        return $this;
    }

Usage Example

 public function its_unlinkFromUserAction_should_unlink_topic_from_user($request, $repository, $user)
 {
     $topic = new Topic();
     $topic->setId(10);
     $topic->setTitle('test');
     $topic->setParent(null);
     $userId = 1;
     $parameterBag = new ParameterBag();
     $parameterBag->set('links', array(array('object' => $topic)));
     $request->attributes = $parameterBag;
     $repository->findOneBy(array('id' => $userId))->shouldBeCalled()->willReturn($user);
     $this->unlinkFromUserAction($request, $userId)->shouldReturn(null);
 }