Service/TaskQueueService.php
public function cleanUpTasks($timePeriod)
    {
        $query = $this->entityManager->createQuery(
            'DELETE
            FROM WebdevviePheanstalkTaskQueueBundle:Task t
            WHERE
            t.status = :status and
            t.created <= :older'
        );
        $query->setParameter('status', array(Task::STATUS_DONE));
        $query->setParameter('older', date("Y-m-d H:i:s", time() - $timePeriod));
        $query->execute();
    }
public function cleanUpTasks($timePeriod)
    {
        $query = $this->entityManager->createQuery(
            'DELETE
            FROM WebdevviePheanstalkTaskQueueBundle:Task t
            WHERE
            t.status = :status and
            t.created <= :older'
        );
        $query->setParameter('status', array(Task::STATUS_DONE));
        $query->setParameter('older', date("Y-m-d H:i:s", time() - $timePeriod));
        $query->execute();
    }
public function cleanUpTasks ( $ timePeriod ) { $ query = $ this -> entityManager -> createQuery ( 'DELETE
            FROM WebdevviePheanstalkTaskQueueBundle:Task t
            WHERE
            t.status = :status and
            t.created <= :older' ) ; $ query -> setParameter ( 'status' , array ( Task :: STATUS_DONE ) ) ; $ query -> setParameter ( 'older' , date ( "Y-m-d H:i:s" , time ( ) - $ timePeriod ) ) ; $ query -> execute ( ) ; }
Cleans up tasks that are marked as done

@param integer $timePeriod
@return void
Cleans up tasks that are marked as done