PluginProbe
Depicter — Popup & Slider Builder / trunk
Depicter — Popup & Slider Builder vtrunk
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Database / Entity / Lead.php

Lead.php in Depicter — Popup & Slider Builder trunk, at app/src/Database/Entity/Lead.php

54 lines 855 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Database\Entity;
3
4 use Averta\WordPress\Database\Entity\Model;
5
6 class Lead extends Model
7 {
8
9 protected $idColumn = 'id';
10
11 protected $idForeign = 'lead_id';
12
13 /**
14 * Resource name.
15 *
16 * @var string
17 */
18 protected $resource = 'depicter_leads';
19
20 /**
21 * Retrieved the joined table name
22 *
23 * @var string
24 */
25 protected string $joined = '';
26
27 /**
28 * Determines what fields can be saved without be explicitly.
29 *
30 * @var array
31 */
32 protected $builtin = [
33 'source_id',
34 'content_id',
35 'content_name',
36 'created_at'
37 ];
38
39 protected $guard = [ 'id' ];
40
41 protected $format = [
42 'created_at' => 'currentDateTime'
43 ];
44
45 public function currentDateTime() {
46 return gmdate('Y-m-d H:i:s', time());
47 }
48
49 public function fields(){
50 return $this->hasMany(LeadField::class, $this->idForeign, $this->idColumn );
51 }
52
53 }
54