VariantOptionValue.php
| 1 | <?php |
| 2 | namespace SureCart\Models; |
| 3 | |
| 4 | use SureCart\Models\DatabaseModel; |
| 5 | |
| 6 | /** |
| 7 | * The integration model. |
| 8 | */ |
| 9 | class VariantOptionValue extends DatabaseModel { |
| 10 | /** |
| 11 | * The integrations table name. |
| 12 | * |
| 13 | * @var string |
| 14 | */ |
| 15 | protected $table_name = 'surecart_variant_option_values'; |
| 16 | |
| 17 | /** |
| 18 | * The object name |
| 19 | * |
| 20 | * @var string |
| 21 | */ |
| 22 | protected $object_name = 'variant_option_values'; |
| 23 | |
| 24 | /** |
| 25 | * Fillable items. |
| 26 | * |
| 27 | * @var array |
| 28 | */ |
| 29 | protected $fillable = [ 'id', 'value', 'name', 'post_id', 'product_id', 'account_id', 'updated_at', 'created_at' ]; |
| 30 | |
| 31 | /** |
| 32 | * Create a new model |
| 33 | * |
| 34 | * @param array $attributes Attributes to create. |
| 35 | * |
| 36 | * @return $this|false |
| 37 | */ |
| 38 | protected function create( $attributes = [] ) { |
| 39 | $attributes['account_id'] = \SureCart::account()->id; |
| 40 | return parent::create( $attributes ); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Update a model |
| 45 | * |
| 46 | * @param array $attributes Attributes to create. |
| 47 | * |
| 48 | * @return $this|false |
| 49 | */ |
| 50 | protected function update( $attributes = [] ) { |
| 51 | $attributes['account_id'] = \SureCart::account()->id; |
| 52 | return parent::update( $attributes ); |
| 53 | } |
| 54 | } |
| 55 |