PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.4
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.4
1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk 1.2.0 All 47 releases
fluent-cart / app / Models / ScheduledAction.php

ScheduledAction.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.4, at app/Models/ScheduledAction.php

61 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Models;
4
5 use FluentCart\App\Services\PlanUpgradeService;
6 use FluentCart\Framework\Database\Orm\Builder;
7 use FluentCart\Framework\Support\Arr;
8
9 /**
10 * Meta Model - DB Model for Meta table
11 *
12 * Database Model
13 *
14 * @package FluentCart\App\Models
15 *
16 * @version 1.0.0
17 */
18 class ScheduledAction extends Model
19 {
20 protected $table = 'fct_scheduled_actions';
21
22 protected $primaryKey = 'id';
23
24 protected $guarded = ['id'];
25
26 protected $fillable = [
27 'scheduled_at',
28 'action',
29 'status',
30 'group',
31 'object_id',
32 'object_type',
33 'completed_at',
34 'retry_count',
35 'data',
36 'response_note',
37 ];
38
39 public function setDataAttribute($value)
40 {
41 if (is_array($value) || is_object($value)) {
42 $this->attributes['data'] = json_encode($value);
43 } else {
44 $this->attributes['data'] = $value;
45 }
46 }
47
48 public function getDataAttribute($value)
49 {
50
51 $decoded = json_decode($value, true);
52
53 if ($decoded && is_array($decoded)) {
54 return $decoded;
55 }
56
57 return [];
58 }
59
60 }
61