protected function protectedSave(
        CacheItemInterface $item,
        $function = 'save'
    )/*# : bool */ {
        // write to both ?
        $func = $this->tester;
        $both = $func($item);

        // if $both is true, write to front
        $res1 = false;
        if ($both) {
            if ($this->front->$function($item)) {
                $res1 = true; // ok
            } else {
                $this->setError(
                    $this->front->getError(),
                    $this->front->getErrorCode()
                );
            }
        }

        // always write to backend
        $res2 = false;
        if ($this->back->$function($item)) {
            $res2 = true; // ok
        } else {
            $this->setError(
                $this->back->getError(),
                $this->back->getErrorCode()
            );
        }

        return $res1 || $res2 ? true : false;
    }
protected function protectedSave(
        CacheItemInterface $item,
        $function = 'save'
    )/*# : bool */ {
        // write to both ?
        $func = $this->tester;
        $both = $func($item);

        // if $both is true, write to front
        $res1 = false;
        if ($both) {
            if ($this->front->$function($item)) {
                $res1 = true; // ok
            } else {
                $this->setError(
                    $this->front->getError(),
                    $this->front->getErrorCode()
                );
            }
        }

        // always write to backend
        $res2 = false;
        if ($this->back->$function($item)) {
            $res2 = true; // ok
        } else {
            $this->setError(
                $this->back->getError(),
                $this->back->getErrorCode()
            );
        }

        return $res1 || $res2 ? true : false;
    }
protected function protectedSave ( CacheItemInterface $ item , $ function = 'save' ) /*# : bool */ { // write to both ? $ func = $ this -> tester ; $ both = $ func ( $ item ) ; // if $both is true, write to front $ res1 = false ; if ( $ both ) { if ( $ this -> front -> $ function ( $ item ) ) { $ res1 = true ; // ok } else { $ this -> setError ( $ this -> front -> getError ( ) , $ this -> front -> getErrorCode ( ) ) ; } } // always write to backend $ res2 = false ; if ( $ this -> back -> $ function ( $ item ) ) { $ res2 = true ; // ok } else { $ this -> setError ( $ this -> back -> getError ( ) , $ this -> back -> getErrorCode ( ) ) ; } return $ res1 || $ res2 ? true : false ; }
local save method, one end save ok is ok

@param  CacheItemInterface $item
@param  string $function save or saveDeferred
@return bool
@access protected
local save method one end save ok is ok