public static function cleanupExpiredSubscription( $time )
    {
        //1. find the subscription which is disabled and whose time is too long
        $startTime = time() - $time;
        $db = eZDB::instance();
        $selectSql = "SELECT id FROM ezcomment_subscription WHERE subscription_time < $startTime AND enabled = 0";
        $result = $db->arrayQuery( $selectSql );
        if ( is_array( $result ) && count( $result ) > 0 )
        {
            //2. clean up the subscription
            $deleteSql = "DELETE FROM ezcomment_subscription WHERE subscription_time < $startTime AND enabled = 0";
            $db->query( $deleteSql );
            return $result;
        }
        else
        {
            return null;
        }
    }
public static function cleanupExpiredSubscription( $time )
    {
        //1. find the subscription which is disabled and whose time is too long
        $startTime = time() - $time;
        $db = eZDB::instance();
        $selectSql = "SELECT id FROM ezcomment_subscription WHERE subscription_time < $startTime AND enabled = 0";
        $result = $db->arrayQuery( $selectSql );
        if ( is_array( $result ) && count( $result ) > 0 )
        {
            //2. clean up the subscription
            $deleteSql = "DELETE FROM ezcomment_subscription WHERE subscription_time < $startTime AND enabled = 0";
            $db->query( $deleteSql );
            return $result;
        }
        else
        {
            return null;
        }
    }
public static function cleanupExpiredSubscription ( $ time ) { //1. find the subscription which is disabled and whose time is too long $ startTime = time ( ) - $ time ; $ db = eZDB :: instance ( ) ; $ selectSql = "SELECT id FROM ezcomment_subscription WHERE subscription_time < $startTime AND enabled = 0" ; $ result = $ db -> arrayQuery ( $ selectSql ) ; if ( is_array ( $ result ) && count ( $ result ) > 0 ) { //2. clean up the subscription $ deleteSql = "DELETE FROM ezcomment_subscription WHERE subscription_time < $startTime AND enabled = 0" ; $ db -> query ( $ deleteSql ) ; return $ result ; } else { return null ; } }
clean up the subscription if the subscription has not been activate for very long
@return array id of subscription cleaned up
null if nothing cleaned up
clean up the subscription if the subscription has not been activate for very long