MatthiasMullie\Scrapbook\Buffered\Utils\Transaction::setMulti PHP Method

setMulti() public method

public setMulti ( array $items, $expire )
$items array
    public function setMulti(array $items, $expire = 0)
    {
        // store the values in memory, so that when we ask for it again later in
        // this same request, we get the value we just set
        $success = $this->local->setMulti($items, $expire);
        // only attempt to store those that we've set successfully to local
        $successful = array_intersect_key($items, $success);
        if (!empty($successful)) {
            $this->defer->setMulti($successful, $expire);
        }
        return $success;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function setMulti(array $items, $expire = 0)
 {
     $result = $this->transaction->setMulti($items, $expire);
     $this->transaction->commit();
     return $result;
 }