@@ 9-33 (lines=25) @@ | ||
6 | use LaravelDoctrine\Fluent\Fluent; |
|
7 | use LaravelDoctrine\Fluent\MappedSuperClassMapping; |
|
8 | ||
9 | class AbstractLogEntryMapping extends MappedSuperClassMapping |
|
10 | { |
|
11 | /** |
|
12 | * {@inheritdoc} |
|
13 | */ |
|
14 | public function mapFor() |
|
15 | { |
|
16 | return AbstractLogEntry::class; |
|
17 | } |
|
18 | ||
19 | /** |
|
20 | * {@inheritdoc} |
|
21 | */ |
|
22 | public function map(Fluent $builder) |
|
23 | { |
|
24 | $builder->increments('id'); |
|
25 | $builder->string('action')->length(8); |
|
26 | $builder->dateTime('loggedAt')->name('logged_at'); |
|
27 | $builder->string('objectId')->name('object_id')->length(64)->nullable(); |
|
28 | $builder->string('objectClass')->name('object_class'); |
|
29 | $builder->integer('version'); |
|
30 | $builder->array('data')->nullable(); |
|
31 | $builder->string('username')->nullable(); |
|
32 | } |
|
33 | } |
|
34 |
@@ 10-34 (lines=25) @@ | ||
7 | use LaravelDoctrine\Fluent\Fluent; |
|
8 | use LaravelDoctrine\Fluent\MappedSuperClassMapping; |
|
9 | ||
10 | class AbstractTranslationMapping extends MappedSuperClassMapping |
|
11 | { |
|
12 | /** |
|
13 | * {@inheritdoc} |
|
14 | */ |
|
15 | public function mapFor() |
|
16 | { |
|
17 | return AbstractTranslation::class; |
|
18 | } |
|
19 | ||
20 | /** |
|
21 | * {@inheritdoc} |
|
22 | */ |
|
23 | public function map(Fluent $builder) |
|
24 | { |
|
25 | $builder->integer('id')->unsigned()->primary()->generatedValue(function (GeneratedValue $builder) { |
|
26 | $builder->identity(); |
|
27 | }); |
|
28 | $builder->string('locale')->length(8); |
|
29 | $builder->string('objectClass')->name('object_class'); |
|
30 | $builder->string('field')->length(32); |
|
31 | $builder->string('foreignKey')->length(64)->name('foreign_key'); |
|
32 | $builder->text('content')->nullable(); |
|
33 | } |
|
34 | } |
|
35 |