Created
July 12, 2015 10:45
-
-
Save Blizzke/7ed3467573cf9b3e08ca to your computer and use it in GitHub Desktop.
AuditEntry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function addBatchData($batchData, $compact = true) | |
{ | |
$columns = ['entry_id', 'type', 'data']; | |
$rows = []; | |
foreach ($batchData as $type => $data) { | |
$rows[] = [$this->id, $type, [Helper::serialize($data, $compact), \PDO::PARAM_LOB]]; | |
} | |
static::getDb()->createCommand()->batchInsert(AuditData::tableName(), $columns, $rows)->execute(); | |
} | |
public function addData($type, $data, $compact = true) | |
{ | |
$record = ['entry_id' => $this->id, 'type' => $type, 'data' => [Helper::serialize($data, $compact), \PDO::PARAM_LOB]]; | |
static::getDb()->createCommand()->insert(AuditData::tableName(), $record)->execute(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment