public function setTtl($key, $expire)
    {
        if (is_null($expire)) {
            return;
        }

        $expire = (int) $expire;

        if ($expire > 0) {
            $this->getConnection()->expire($key, $expire);
        } else {
            $this->getConnection()->persist($key);
        }
    }
public function setTtl($key, $expire)
    {
        if (is_null($expire)) {
            return;
        }

        $expire = (int) $expire;

        if ($expire > 0) {
            $this->getConnection()->expire($key, $expire);
        } else {
            $this->getConnection()->persist($key);
        }
    }
public function setTtl ( $ key , $ expire ) { if ( is_null ( $ expire ) ) { return ; } $ expire = ( int ) $ expire ; if ( $ expire > 0 ) { $ this -> getConnection ( ) -> expire ( $ key , $ expire ) ; } else { $ this -> getConnection ( ) -> persist ( $ key ) ; } }
Set a timeout on key.

@param string $key
@param int    $expire

@return void
Set a timeout on key .