You are here

function advagg_insert_aggregate_version in Advanced CSS/JS Aggregation 7.2

Insert data in the advagg_aggregates_versions table.

Parameters

string $aggregate_filenames_hash: Hash of the groupings of files.

string $aggregate_contents_hash: Hash of the files contents.

int $root: Is this a root aggregate.

Return value

bool Return TRUE if anything was written to the database.

1 call to advagg_insert_aggregate_version()
advagg_insert_update_db in ./advagg.inc
Insert/Update data in advagg tables.

File

./advagg.inc, line 63
Advanced CSS/JS aggregation module.

Code

function advagg_insert_aggregate_version($aggregate_filenames_hash, $aggregate_contents_hash, $root) {

  // Info for the DB.
  $record = array(
    'aggregate_filenames_hash' => $aggregate_filenames_hash,
    'aggregate_contents_hash' => $aggregate_contents_hash,
    'atime' => 0,
    'root' => $root,
  );

  // Save new aggregate into the database if it does not exist.
  $return = db_merge('advagg_aggregates_versions')
    ->key(array(
    'aggregate_filenames_hash' => $record['aggregate_filenames_hash'],
    'aggregate_contents_hash' => $record['aggregate_contents_hash'],
  ))
    ->insertFields($record)
    ->execute();
  return $return;
}