/** * Determine whether $post is in the current term * * @param Fishpig_Wordpress_Model_Term $term * @param int|Fishpig_Wordpress_Model_Post_Abstract $object * @return bool */ public function containsPost($term, $object) { $objectId = is_object($object) ? $object->getId() : $object; if (!$objectId || $term->getItemCount() === 0) { return false; } $select = $this->_getReadAdapter()->select()->from($this->getTable('wordpress/term_relationship'), 'object_id')->where('term_taxonomy_id = ?', $term->getTermTaxonomyId())->where('object_id = ?', $objectId)->limit(1); return $this->_getReadAdapter()->fetchOne($select) !== false; }