Exemple #1
0
 /**
  * Determine whether the given post has any children posts
  *
  * @param Fishpig_Wordpress_Model_Post $post
  * @return bool
  */
 public function hasChildrenPosts(Fishpig_Wordpress_Model_Post $post)
 {
     $select = $this->_getReadAdapter()->select()->from($this->getMainTable(), 'ID')->where('post_parent=?', $post->getId())->where('post_type=?', $post->getPostType())->where('post_status=?', 'publish')->limit(1);
     return $this->_getReadAdapter()->fetchOne($select) !== false;
 }