public function getParent()
    {
        if ($this->parent === null) {
            if (($parentId = $this->getParentPostId()) !== null) {
                $this->parent = $this->postFactory->create(get_post($parentId));
            } else {
                $this->parent = false;
            }
        }

        return $this->parent ?: null;
    }
public function getParent()
    {
        if ($this->parent === null) {
            if (($parentId = $this->getParentPostId()) !== null) {
                $this->parent = $this->postFactory->create(get_post($parentId));
            } else {
                $this->parent = false;
            }
        }

        return $this->parent ?: null;
    }
public function getParent ( ) { if ( $ this -> parent === null ) { if ( ( $ parentId = $ this -> getParentPostId ( ) ) !== null ) { $ this -> parent = $ this -> postFactory -> create ( get_post ( $ parentId ) ) ; } else { $ this -> parent = false ; } } return $ this -> parent ? : null ; }
Get the parent post, if set.

@return \Tev\Post\Model\AbstractPost|null
Get the parent post if set .