Comments (3)
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.
I extended the viewhelper and done it that way! Thanks though!
from rbcomment.
Ok, great! Closing the issue then.
from rbcomment.
Related Issues (5)
- ZfcUser HOT 3
- Closure in module config will cause fatal if config cache is enabled HOT 1
- csrf issue HOT 2
- plugin ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbcomment.