/** * @param int|Post $object * @return $this */ public function setObjectId($object = 0) { if ($object instanceof Post) { $this->objectId = $object->getId(); } else { $this->objectId = (int) $object; } return $this; }
/** * @param int|Post $post * @return $this */ public function setPostId($post = 0) { if ($post instanceof Post) { $this->postId = $post->getId(); } else { $this->postId = (int) $post; } return $this; }
/** * Find the terms related to the given post. * * @param Post $post * @return TermRelationship[] */ public function findByPost(Post $post) { return $this->findBy(['objectId' => $post->getId()]); }
/** * @param int|Post $parent * @return $this */ public function setParentId($parent = 0) { if ($parent instanceof Post) { $this->parentId = $parent->getId(); } else { $this->parentId = (int) $parent; } return $this; }