1: <?php namespace Laravella\Crud;
2:
3: use Laravella\Crud\Log;
4: use \Seeder;
5: use \DB;
6:
7: class UpdateCMSFields extends CrudSeeder {
8:
9: private function updateField($tableName, $fieldName, $widgetType)
10: {
11: $tableId = DB::table('_db_tables')->where('name', $tableName)->pluck('id');
12:
13:
14:
15: $widgetTypeId = DB::table('_db_widget_types')
16: ->where('name', $widgetType)
17: ->pluck('id');
18:
19:
20:
21: $displayTypeId = DB::table('_db_display_types')
22: ->where('name', 'widget')
23: ->pluck('id');
24:
25: DB::table('_db_fields')
26: ->where('table_id', $tableId)
27: ->where('name', $fieldName)
28: ->update(array('widget_type_id' => $widgetTypeId, 'display_type_id' => $displayTypeId));
29: }
30:
31: public function run()
32: {
33:
34:
35:
36: }
37:
38: }
39:
40: ?>