PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 1.0.93
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v1.0.93
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
fluent-community / app / Models / Meta.php

Meta.php in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses 1.0.93, at app/Models/Meta.php

55 lines 997 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCommunity\App\Models;
4
5 /**
6 * Meta Model - DB Model for Meta table
7 *
8 * Database Model
9 *
10 * @package FluentCommunity\App\Models
11 *
12 * @version 1.0.0
13 */
14 class Meta extends Model
15 {
16 protected $table = 'fcom_meta';
17
18 protected $primaryKey = 'id';
19
20 protected $guarded = ['id'];
21
22 protected $fillable = [
23 'object_type',
24 'object_id',
25 'meta_key',
26 'value'
27 ];
28
29 public function setValueAttribute($value)
30 {
31 $this->attributes['value'] = maybe_serialize($value);
32 }
33
34 public function getValueAttribute($value)
35 {
36 return maybe_unserialize($value);
37 }
38
39 public function scopeByType($query, $type)
40 {
41 return $query->where('object_type', $type);
42 }
43
44 public function scopeByMetaKey($query, $key)
45 {
46 return $query->where('meta_key', $key);
47 }
48
49 public function scopeByObjectId($query, $objectId)
50 {
51 return $query->where('object_id', $objectId);
52 }
53
54 }
55