/** * Returns true if users from portal can post a comment to this object * * @param Portal $portal * @return boolean */ function canCommentByPortal($portal) { if (!$this->can_have_comments || !$portal->getIsCommentable() || $this->getIsLocked() || $this->getState() < STATE_VISIBLE) { return false; } // if return $this->canViewByPortal($portal); }