app/Repositories/CandlestickNodeRepository.php
/**
	 * Save a large amount of nodes. Pass them as an array of value maps.
	 * @param CandlestickNode[] $nodes
	 * @return bool
	 */
Save a large amount of nodes. Pass them as an array of value maps.
@param CandlestickNode[] $nodes
@return bool
Save a large amount of nodes . Pass them as an array of value maps . @param CandlestickNode [] $nodes @return bool
public function bulkSave($nodes)
	{
		$data = [];
		foreach ($nodes as $node) {
			$data = array_merge($data, [$node->open, $node->high, $node->low, $node->close, $node->volume,
				$node->open_time, $node->close_time, $node->interval, $node->valuta_pair_id]);
		}
		$parameter_holders = implode(',', array_fill(0, count($nodes), '(?,?,?,?,?,?,?,?,?)'));
		return \DB::insert('INSERT IGNORE INTO candlestick_nodes (candlestick_nodes.open, high, low, candlestick_nodes.close, volume, open_time, close_time, candlestick_nodes.interval, valuta_pair_id) VALUES ' . $parameter_holders, $data);
	}
public function bulkSave ( $ nodes ) { $ data = [ ] ; foreach ( $ nodes as $ node ) { $ data = array_merge ( $ data , [ $ node -> open , $ node -> high , $ node -> low , $ node -> close , $ node -> volume , $ node -> open_time , $ node -> close_time , $ node -> interval , $ node -> valuta_pair_id ] ) ; } $ parameter_holders = implode ( ',' , array_fill ( 0 , count ( $ nodes ) , '(?,?,?,?,?,?,?,?,?)' ) ) ; return \ DB :: insert ( 'INSERT IGNORE INTO candlestick_nodes (candlestick_nodes.open, high, low, candlestick_nodes.close, volume, open_time, close_time, candlestick_nodes.interval, valuta_pair_id) VALUES ' . $ parameter_holders , $ data ) ; }
Save a large amount of nodes.
Save a large amount of nodes .