protected function fixCommonFields(array & $record, $unsetIdField = true)
    {
        if ($unsetIdField) {
            unset($record['id']);
        }
        if (isset($record['last_modified_by_id'])) {
            unset($record['last_modified_by_id']);
        }
        if (isset($record['created_by_id'])) {
            $record['created_by_id'] = Session::getCurrentUserId();
        }
    }
protected function fixCommonFields(array & $record, $unsetIdField = true)
    {
        if ($unsetIdField) {
            unset($record['id']);
        }
        if (isset($record['last_modified_by_id'])) {
            unset($record['last_modified_by_id']);
        }
        if (isset($record['created_by_id'])) {
            $record['created_by_id'] = Session::getCurrentUserId();
        }
    }
protected function fixCommonFields ( array & $ record , $ unsetIdField = true ) { if ( $ unsetIdField ) { unset ( $ record [ 'id' ] ) ; } if ( isset ( $ record [ 'last_modified_by_id' ] ) ) { unset ( $ record [ 'last_modified_by_id' ] ) ; } if ( isset ( $ record [ 'created_by_id' ] ) ) { $ record [ 'created_by_id' ] = Session :: getCurrentUserId ( ) ; } }
Fix some common fields to make record ready for
inserting into db table.

@param array $record
@param bool  $unsetIdField
Fix some common fields to make record ready for inserting into db table .