public function insert($key, $value, $ttl, $time)
    {
        if ($this->serializer->isSerializeable($value)) {
            $value = $this->serializer->serialize($value);
        }

        $query = sprintf('INSERT INTO `%s` (`key`, `value`, `ttl`, `created_on`) VALUES (:key, :value, :ttl, :created_on)', $this->table);
        $stmt = $this->pdo->prepare($query);

        return $stmt->execute(array(
            ':'.ConstProviderInterface::CACHE_PARAM_KEY =>  $key,
            ':'.ConstProviderInterface::CACHE_PARAM_VALUE => $value,
            ':'.ConstProviderInterface::CACHE_PARAM_TTL =>  $ttl,
            ':'.ConstProviderInterface::CACHE_PARAM_CREATED_ON => time(),
        ));
    }
public function insert($key, $value, $ttl, $time)
    {
        if ($this->serializer->isSerializeable($value)) {
            $value = $this->serializer->serialize($value);
        }

        $query = sprintf('INSERT INTO `%s` (`key`, `value`, `ttl`, `created_on`) VALUES (:key, :value, :ttl, :created_on)', $this->table);
        $stmt = $this->pdo->prepare($query);

        return $stmt->execute(array(
            ':'.ConstProviderInterface::CACHE_PARAM_KEY =>  $key,
            ':'.ConstProviderInterface::CACHE_PARAM_VALUE => $value,
            ':'.ConstProviderInterface::CACHE_PARAM_TTL =>  $ttl,
            ':'.ConstProviderInterface::CACHE_PARAM_CREATED_ON => time(),
        ));
    }
public function insert ( $ key , $ value , $ ttl , $ time ) { if ( $ this -> serializer -> isSerializeable ( $ value ) ) { $ value = $ this -> serializer -> serialize ( $ value ) ; } $ query = sprintf ( 'INSERT INTO `%s` (`key`, `value`, `ttl`, `created_on`) VALUES (:key, :value, :ttl, :created_on)' , $ this -> table ) ; $ stmt = $ this -> pdo -> prepare ( $ query ) ; return $ stmt -> execute ( array ( ':' . ConstProviderInterface :: CACHE_PARAM_KEY => $ key , ':' . ConstProviderInterface :: CACHE_PARAM_VALUE => $ value , ':' . ConstProviderInterface :: CACHE_PARAM_TTL => $ ttl , ':' . ConstProviderInterface :: CACHE_PARAM_CREATED_ON => time ( ) , ) ) ; }
Inserts new cache's record

@param string $key
@param mixed
@param integer $ttl Time to live in seconds
@param integer $time Current timestamp
@return boolean
Inserts new cache s record