Write many cache entries to the cache at once

@param array $data An array of data to be stored in the cache
@return array of bools for each key provided, true if the data was
successfully cached, false on failure
505007
public function writeMany($data)
    {
        $cacheData = [];
        foreach ($data as $key => $value) {
            $cacheData[$this->_key($key)] = $value;
        }

        $success = $this->_Memcached->setMulti($cacheData);

        $return = [];
        foreach (array_keys($data) as $key) {
            $return[$key] = $success;
        }

        return $return;
    }
51652
private function isArray($data): bool
    {
        $counter = 0;
        foreach ($data as $key => $value) {
            if ($key !== $counter) {
                return false;
            }

            ++$counter;
        }

        return true;
    }
1364782
public function append($data)
	{
		$bites = file_put_contents($this->path, $data, FILE_APPEND | LOCK_EX);

		return $bites !== false;
	}
9990
private function write( $data ) {

		if( !$this->connection->established ) {

			Log::info('LxMPD connection is NOT established', array($data));

                        $this->connection->establish();
                }

		if( !fputs( $this->connection->socket, "$data\n" ) ) {

			Log::info('LxMPD write fputs seems to have failed writing to socket', array($data));

			throw new MPDException( 'Failed to write to MPD socket', self::MPD_WRITE_FAILED );
                }

                return true;
        }
802323
public function batchInsert(array $data)
    {
        $ids = [];
        foreach ($data as $item) {
            if (isset($item['id'])) {
                if (array_key_exists($item['id'], $this->table->data['data'])) {
                    continue;
                }
            } else {
                $item = ['id' => $this->generateId()] + $item;
            }

            $ids[] = $this->insert($item);
        }

        return $ids;
    }
882609
final public function save(array $data)
    {
        return array_key_exists('id', $data) ?
            $this->update($data) :
            $this->insert($data);
    }
140165
public function stream_write($data) {
    assert(isset($this->client));
    return $this->client->write($data);
  }
1060058
public function upload(array $data)
    {
        $content = $this->readCSV($data);
        if ($content === false) {
            return false;
        }

        $return = $this->writeFile($data['locale'], $content, 'csv');
        if ($return === false) {
            return false;
        }

        return $this->activeTranslate($data['locale']);

    }
560685
public function update(array $data)
    {
        // setup the custom options
        foreach ($this->getCustomOptions() as $key => $value) {
            if (isset($data[$value]) && $data[$value] == 'custom' && $data[$value . '_custom'] != '') {
                $data['_form_' . $value] = $data[$value];
                $data[$value] = $data[$value . '_custom'];
            }
        }
        
        foreach ($data as $key => $value) {
            if (in_array($key, $this->getSerialized())) {
                $value = (is_array($value) ? serialize($value) : serialize(array(
                    $value
                )));
            }
            
            if (in_array($key, $this->getEncrypted()) && $value != '') {
                $value = $this->getEncrypt()->encode($value);
            }
            
            $this->updateSetting($key, $value);
        }
        
        return true;
    }
1114525
public function writeData($data)
	{
		if (strlen($data) - 4 > $this->_limit) {
			$data = $this->_addContinue($data);
		}
		$this->_datasize += strlen($data);

		return $data;
	}
37047
public function write($data) : bool
    {
        $success = false;

        if ($this->isFile() && $this->isWriteable()) {
            $success = file_put_contents($this->realPath, $data) !== false;
        }

        return $success;
    }
769308
public function overwriteWith($data)
    {
        if (is_array($data)) {
            $this->data = $data + $this->data;
        } elseif ($data instanceof Collection) {
            $this->data = $data->toArray() + $this->data;
        } else {
            foreach ($data as $key => $value) {
                $this->data[$key] = $value;
            }
        }

        return $this;
    }
524755
public function add(array $data)
    {
        if (!$this->isDb()) {
            return false;
        }

        $data += array(
            'created' => GC_TIME,
            'log_id' => gplcart_string_random(6)
        );

        try {
            $result = (bool) $this->db->insert('log', $data);
        } catch (Exception $ex) {
            $result = false;
        }

        return $result;
    }
653306
private function cacheIsset($keys)
    {
        $has   = false;
        $array = $this->cache;

        foreach ($keys as $key) {
            if ($has = array_key_exists($key, $array)) {
                $array = $array[$key];
            }
        }

        if (is_array($array)) {
            $has = $has && array_key_exists(0, $array);
        }

        return $has;
    }
713488
public function insert(array $data): self
    {
        $this->reset();
        // simply check is not assoc to prepare multi-insert
        if (!isset($data[0])) {
            $data = [$data];
        }

        return $this->push('insert', $data);
    }
327381
public function addEntry($data = [])
    {
        if(!$data)
            return false;
        (!isset($data[$this->databaseConfig->getIdentifier()])) ? $this->clearIdentifier() : $this->get($data[$this->databaseConfig->getIdentifier()]);
        foreach ($data as $name => $value){
            if ($this->checkField($name))
                $this->tableFields->{$name} = utf8_encode($value);
        }
        return $this->save();
    }
313110
protected function arrayDotKeysFlattern(array $data)
    {
        foreach ($data as $name => $values) {
            if ($this->isIterable($values)) {
                foreach ($values as $key => $key_value) {
                    $data["$name.$key"] = $values[$key];
                }
                unset($data[$name]);
            }
        }
        return $data;
    }