13693261870
2022-09-16 354b3dbfbffb3df45212a2a44dbbf48b4acc2594
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * Model for a book
 */
Ext.define('Books.model.Book', {
    extend: 'Ext.data.Model',
    requires: ['Books.model.Review', 'Ext.data.association.HasMany', 'Ext.data.association.BelongsTo'],
 
    fields: [
        'id',
        'name',
        'author',
        'detail',
        'price',
        'image'
    ],
 
    hasMany: {
        model: 'Books.model.Review', 
        name: 'reviews',
        foreignKey: 'book_id'
    }
});