Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your comments are handled as content objects (basically if you don't use eZ Comments), then the latest comment might be retrieved in PHP using the <em>same</em> syntax that you usually use in templates (<a href="http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/tree" rel="nofollow">http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/tree</a>), for instance :</p> <pre class="lang-php prettyprint-override"><code>$params = array( 'ClassFilterType' =&gt; 'include', 'ClassFilterArray' =&gt; array( 'comment' ), 'SortBy' =&gt; array( 'published', true ), 'Offset' =&gt; 0, 'Limit' =&gt; 1 ); $lastComment = eZContentObjectTreeNode::subTreeByNodeID( $params, 2 ); </code></pre> <p>Note that you might need to change the class identifier to something different than <em>comment</em> (which is the default one when installing eZ Webin or eZ Flow) and the parent node_id from where you'll <em>browse</em> your content subtree (which in my example is <strong>2</strong>.</p> <p>Then if you want to remove that content, you can take a piece of code in one of these module/views :</p> <ul> <li>content/removenode (defined in kernel/content/removenode.php)</li> <li>content/removeobject (defined in kernel/content/removeobject.php)</li> </ul> <p>Take care when removing a content object from your content repository, there are several operations to complete :</p> <ul> <li>remove the location(s) (what we call the node(s) actually)</li> <li>remove the object</li> <li>clear the cache in some case</li> </ul> <p>Hope this helps</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload