private static function getNextItem()
    {
        $pendingStatusValue = ezpContentPublishingProcess::STATUS_PENDING;
        $workingStatusValue = ezpContentPublishingProcess::STATUS_WORKING;

        $sql = <<< SQL
SELECT *
FROM
  ezpublishingqueueprocesses p,
  ezcontentobject_version v
WHERE p.status = $pendingStatusValue
  AND p.ezcontentobject_version_id = v.id
  AND v.contentobject_id NOT IN (
    SELECT v.contentobject_id
    FROM ezpublishingqueueprocesses p,
      ezcontentobject_version v
    WHERE
      p.ezcontentobject_version_id = v.id
      AND p.status = $workingStatusValue
  )
ORDER BY p.created, p.ezcontentobject_version_id ASC
SQL;
        $db = eZDB::instance();
        $rows = $db->arrayQuery( $sql, array( 'offset' => 0, 'limit' => 1 ) );
        if ( count( $rows ) == 0 )
            return false;

        /** @var ezpContentPublishingProcess[] $persistentObjects */
        $persistentObjects = eZPersistentObject::handleRows( $rows, 'ezpContentPublishingProcess', true );
        return $persistentObjects[0];
    }