Giter VIP home page Giter VIP logo

Comments (3)

robertmarsal avatar robertmarsal commented on July 19, 2024

Hi,

I just released v1.4.0 (that I had in my backlog for a while now). You should be able to upgrade from 1.3.0 without problems as I have made no changes only adding new features and fixing bugs.

In this release I have added two new methods to the CommentTable class:

  • fetchAllPendingForThread : This will return all the pending (visible === 0) comments for a thread.
  • fetchAllUsingSelect : This allows executing custom queries against the comments table. The argument it takes is a Zend\Db\Sql\Select so you can make any query you might need.

I believe these two method should provide you with what you need.

To use the class you should add to your controller:

    /**
     * @var \RbComment\Model\CommentTable
     */
    protected $commentTable;

    /**
     * @return \RbComment\Model\CommentTable
     */
    public function getCommentTable()
    {
        if (!$this->commentTable) {
            $sm = $this->getServiceLocator();
            $this->commentTable = $sm->get('RbComment\Model\CommentTable');
        }

        return $this->commentTable;
    }

And then inside your action call:

public function myAction()
{
 ...
$pendingComments = $this->getCommentTable()->fetchAllPendingForThread($thread);
}

The thread is just the sha1() of the uri. If in doubt check: https://github.com/robertboloc/RbComment/blob/master/src/RbComment/View/Helper/Comment.php#L41

Hope this helps.

from rbcomment.

ionutfechete avatar ionutfechete commented on July 19, 2024

I extended the viewhelper and done it that way! Thanks though!

from rbcomment.

robertmarsal avatar robertmarsal commented on July 19, 2024

Ok, great! Closing the issue then.

from rbcomment.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.