MatthiasMullie\Scrapbook\Buffered\Utils\Transaction::deleteMulti PHP Метод

deleteMulti() публичный Метод

public deleteMulti ( array $keys )
$keys array
    public function deleteMulti(array $keys)
    {
        // check the current values to see if they currently exists, so we can
        // properly return true/false as would be expected from KeyValueStore
        $items = $this->getMulti($keys);
        $success = array();
        foreach ($keys as $key) {
            $success[$key] = array_key_exists($key, $items);
        }
        // only attempt to store those that we've deleted successfully to local
        $values = array_intersect_key($success, array_flip($keys));
        if (empty($values)) {
            return array();
        }
        // mark all as expired in local cache (see comment in delete())
        $this->local->setMulti($values, -1);
        $this->defer->deleteMulti(array_keys($values));
        return $success;
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function deleteMulti(array $keys)
 {
     $result = $this->transaction->deleteMulti($keys);
     $this->transaction->commit();
     return $result;
 }