Test Failed
Push — master ( 482637...7bef58 )
by Julito
33:32
created

BranchSync::getLastSyncTransDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Entity;
5
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
9
/**
10
 * BranchSync.
11
 *
12
 * @ORM\Table(name="branch_sync")
13
 * @ORM\Entity(repositoryClass="Chamilo\CoreBundle\Entity\Repository\BranchSyncRepository")
14
 * @Gedmo\Tree(type="nested")
15
 */
16
class BranchSync
17
{
18
    /**
19
     * @var int
20
     *
21
     * @ORM\Column(name="id", type="integer", nullable=false, unique=false)
22
     * @ORM\Id
23
     * @ORM\GeneratedValue
24
     */
25
    private $id;
26
27
    /**
28
     * @var int
29
     *
30
     * @ORM\Column(name="access_url_id", type="integer", nullable=false, unique=false)
31
     */
32
    private $accessUrlId;
33
34
    /**
35
     * @var string
36
     *
37
     * @ORM\Column(name="unique_id", type="string", length=50, nullable=false, unique=true)
38
     */
39
    private $uniqueId;
40
41
    /**
42
     * @var string
43
     *
44
     * @ORM\Column(name="branch_name", type="string", length=250, nullable=false, unique=false)
45
     */
46
    private $branchName;
47
48
    /**
49
     * @var string
50
     *
51
     * @ORM\Column(name="description", type="text", nullable=true)
52
     */
53
    private $description;
54
55
    /**
56
     * @var string
57
     *
58
     * @ORM\Column(name="branch_ip", type="string", length=40, nullable=true, unique=false)
59
     */
60
    private $branchIp;
61
62
    /**
63
     * @var float
64
     *
65
     * @ORM\Column(name="latitude", type="decimal", nullable=true, unique=false)
66
     */
67
    private $latitude;
68
69
    /**
70
     * @var float
71
     *
72
     * @ORM\Column(name="longitude", type="decimal", nullable=true, unique=false)
73
     */
74
    private $longitude;
75
76
    /**
77
     * @var int
78
     *
79
     * @ORM\Column(name="dwn_speed", type="integer", nullable=true, unique=false)
80
     */
81
    private $dwnSpeed;
82
83
    /**
84
     * @var int
85
     *
86
     * @ORM\Column(name="up_speed", type="integer", nullable=true, unique=false)
87
     */
88
    private $upSpeed;
89
90
    /**
91
     * @var int
92
     *
93
     * @ORM\Column(name="delay", type="integer", nullable=true, unique=false)
94
     */
95
    private $delay;
96
97
    /**
98
     * @var string
99
     *
100
     * @ORM\Column(name="admin_mail", type="string", length=250, nullable=true, unique=false)
101
     */
102
    private $adminMail;
103
104
    /**
105
     * @var string
106
     *
107
     * @ORM\Column(name="admin_name", type="string", length=250, nullable=true, unique=false)
108
     */
109
    private $adminName;
110
111
    /**
112
     * @var string
113
     *
114
     * @ORM\Column(name="admin_phone", type="string", length=250, nullable=true, unique=false)
115
     */
116
    private $adminPhone;
117
118
    /**
119
     * @var int
120
     *
121
     * @ORM\Column(name="last_sync_trans_id", type="bigint", nullable=true, unique=false)
122
     */
123
    private $lastSyncTransId;
124
125
    /**
126
     * @var \DateTime
127
     *
128
     * @ORM\Column(name="last_sync_trans_date", type="datetime", nullable=true, unique=false)
129
     */
130
    private $lastSyncTransDate;
131
132
    /**
133
     * @var string
134
     *
135
     * @ORM\Column(name="last_sync_type", type="string", length=20, nullable=true, unique=false)
136
     */
137
    private $lastSyncType;
138
139
    /**
140
     * @var string
141
     *
142
     * @ORM\Column(name="ssl_pub_key", type="string", length=250, nullable=true, unique=false)
143
     */
144
    private $sslPubKey;
145
146
    /**
147
     * @var string
148
     *
149
     * @ORM\Column(name="branch_type", type="string", length=250, nullable=true, unique=false)
150
     */
151
    private $branchType;
152
153
    /**
154
     * @var int
155
     * @Gedmo\TreeLeft
156
     * @ORM\Column(name="lft", type="integer", nullable=true, unique=false)
157
     */
158
    private $lft;
159
160
    /**
161
     * @var int
162
     * @Gedmo\TreeRight
163
     * @ORM\Column(name="rgt", type="integer", nullable=true, unique=false)
164
     */
165
    private $rgt;
166
167
    /**
168
     * @var int
169
     * @Gedmo\TreeLevel
170
     * @ORM\Column(name="lvl", type="integer", nullable=true, unique=false)
171
     */
172
    private $lvl;
173
174
    /**
175
     * @var int
176
     * @Gedmo\TreeRoot
177
     * @ORM\Column(name="root", type="integer", nullable=true, unique=false)
178
     */
179
    private $root;
180
181
    /**
182
     * @var int
183
     *
184
     * @ORM\Column(name="parent_id", type="integer", nullable=true, unique=false)
185
     */
186
    private $parentId;
187
188
    /**
189
     * @Gedmo\TreeParent
190
     * @ORM\ManyToOne(targetEntity="BranchSync", inversedBy="children")
191
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
192
     */
193
    private $parent;
194
195
    /**
196
     * @ORM\OneToMany(targetEntity="BranchSync", mappedBy="parent")
197
     * @ORM\OrderBy({"lft" = "ASC"})
198
     */
199
    private $children;
0 ignored issues
show
introduced by
The private property $children is not used, and could be removed.
Loading history...
200
201
    /**
202
     * Constructor.
203
     */
204
    public function __construct()
205
    {
206
        $this->uniqueId = sha1(uniqid());
207
        $this->sslPubKey = sha1(uniqid());
208
        // $this->lastSyncTransDate = new \DateTime();
209
    }
210
211
    /**
212
     * Get id.
213
     *
214
     * @return int
215
     */
216
    public function getId()
217
    {
218
        return $this->id;
219
    }
220
221
    /**
222
     * Set accessUrlId.
223
     *
224
     * @param int $accessUrlId
225
     *
226
     * @return BranchSync
227
     */
228
    public function setAccessUrlId($accessUrlId)
229
    {
230
        $this->accessUrlId = $accessUrlId;
231
232
        return $this;
233
    }
234
235
    /**
236
     * Get accessUrlId.
237
     *
238
     * @return int
239
     */
240
    public function getAccessUrlId()
241
    {
242
        return $this->accessUrlId;
243
    }
244
245
    /**
246
     * Set branchName.
247
     *
248
     * @param string $branchName
249
     *
250
     * @return BranchSync
251
     */
252
    public function setBranchName($branchName)
253
    {
254
        $this->branchName = $branchName;
255
256
        return $this;
257
    }
258
259
    /**
260
     * Get branchName.
261
     *
262
     * @return string
263
     */
264
    public function getBranchName()
265
    {
266
        return $this->branchName;
267
    }
268
269
    /**
270
     * Set branchIp.
271
     *
272
     * @param string $branchIp
273
     *
274
     * @return BranchSync
275
     */
276
    public function setBranchIp($branchIp)
277
    {
278
        $this->branchIp = $branchIp;
279
280
        return $this;
281
    }
282
283
    /**
284
     * Get branchIp.
285
     *
286
     * @return string
287
     */
288
    public function getBranchIp()
289
    {
290
        return $this->branchIp;
291
    }
292
293
    /**
294
     * Set latitude.
295
     *
296
     * @param float $latitude
297
     *
298
     * @return BranchSync
299
     */
300
    public function setLatitude($latitude)
301
    {
302
        $this->latitude = $latitude;
303
304
        return $this;
305
    }
306
307
    /**
308
     * Get latitude.
309
     *
310
     * @return float
311
     */
312
    public function getLatitude()
313
    {
314
        return $this->latitude;
315
    }
316
317
    /**
318
     * Set longitude.
319
     *
320
     * @param float $longitude
321
     *
322
     * @return BranchSync
323
     */
324
    public function setLongitude($longitude)
325
    {
326
        $this->longitude = $longitude;
327
328
        return $this;
329
    }
330
331
    /**
332
     * Get longitude.
333
     *
334
     * @return float
335
     */
336
    public function getLongitude()
337
    {
338
        return $this->longitude;
339
    }
340
341
    /**
342
     * Set dwnSpeed.
343
     *
344
     * @param int $dwnSpeed
345
     *
346
     * @return BranchSync
347
     */
348
    public function setDwnSpeed($dwnSpeed)
349
    {
350
        $this->dwnSpeed = $dwnSpeed;
351
352
        return $this;
353
    }
354
355
    /**
356
     * Get dwnSpeed.
357
     *
358
     * @return int
359
     */
360
    public function getDwnSpeed()
361
    {
362
        return $this->dwnSpeed;
363
    }
364
365
    /**
366
     * Set upSpeed.
367
     *
368
     * @param int $upSpeed
369
     *
370
     * @return BranchSync
371
     */
372
    public function setUpSpeed($upSpeed)
373
    {
374
        $this->upSpeed = $upSpeed;
375
376
        return $this;
377
    }
378
379
    /**
380
     * Get upSpeed.
381
     *
382
     * @return int
383
     */
384
    public function getUpSpeed()
385
    {
386
        return $this->upSpeed;
387
    }
388
389
    /**
390
     * Set delay.
391
     *
392
     * @param int $delay
393
     *
394
     * @return BranchSync
395
     */
396
    public function setDelay($delay)
397
    {
398
        $this->delay = $delay;
399
400
        return $this;
401
    }
402
403
    /**
404
     * Get delay.
405
     *
406
     * @return int
407
     */
408
    public function getDelay()
409
    {
410
        return $this->delay;
411
    }
412
413
    /**
414
     * Set adminMail.
415
     *
416
     * @param string $adminMail
417
     *
418
     * @return BranchSync
419
     */
420
    public function setAdminMail($adminMail)
421
    {
422
        $this->adminMail = $adminMail;
423
424
        return $this;
425
    }
426
427
    /**
428
     * Get adminMail.
429
     *
430
     * @return string
431
     */
432
    public function getAdminMail()
433
    {
434
        return $this->adminMail;
435
    }
436
437
    /**
438
     * Set adminName.
439
     *
440
     * @param string $adminName
441
     *
442
     * @return BranchSync
443
     */
444
    public function setAdminName($adminName)
445
    {
446
        $this->adminName = $adminName;
447
448
        return $this;
449
    }
450
451
    /**
452
     * Get adminName.
453
     *
454
     * @return string
455
     */
456
    public function getAdminName()
457
    {
458
        return $this->adminName;
459
    }
460
461
    /**
462
     * Set adminPhone.
463
     *
464
     * @param string $adminPhone
465
     *
466
     * @return BranchSync
467
     */
468
    public function setAdminPhone($adminPhone)
469
    {
470
        $this->adminPhone = $adminPhone;
471
472
        return $this;
473
    }
474
475
    /**
476
     * Get adminPhone.
477
     *
478
     * @return string
479
     */
480
    public function getAdminPhone()
481
    {
482
        return $this->adminPhone;
483
    }
484
485
    /**
486
     * Set lastSyncTransId.
487
     *
488
     * @param int $lastSyncTransId
489
     *
490
     * @return BranchSync
491
     */
492
    public function setLastSyncTransId($lastSyncTransId)
493
    {
494
        $this->lastSyncTransId = $lastSyncTransId;
495
496
        return $this;
497
    }
498
499
    /**
500
     * Get lastSyncTransId.
501
     *
502
     * @return int
503
     */
504
    public function getLastSyncTransId()
505
    {
506
        return $this->lastSyncTransId;
507
    }
508
509
    /**
510
     * Set lastSyncTransDate.
511
     *
512
     * @param \DateTime $lastSyncTransDate
513
     *
514
     * @return BranchSync
515
     */
516
    public function setLastSyncTransDate($lastSyncTransDate)
517
    {
518
        $this->lastSyncTransDate = $lastSyncTransDate;
519
520
        return $this;
521
    }
522
523
    /**
524
     * Set sslPubKey.
525
     *
526
     * @param string $sslPubKey
527
     *
528
     * @return BranchSync
529
     */
530
    public function setSslPubKey($sslPubKey)
531
    {
532
        $this->sslPubKey = $sslPubKey;
533
534
        return $this;
535
    }
536
537
    /**
538
     * Get sslPubKey.
539
     *
540
     * @return string
541
     */
542
    public function getSslPubKey()
543
    {
544
        return $this->sslPubKey;
545
    }
546
547
    /**
548
     * Set sslPubKey.
549
     *
550
     * @param string $branchType
551
     *
552
     * @return BranchSync
553
     */
554
    public function setBranchType($branchType)
555
    {
556
        $this->branchType = $branchType;
557
558
        return $this;
559
    }
560
561
    /**
562
     * Get sslPubKey.
563
     *
564
     * @return string
565
     */
566
    public function getBranchType()
567
    {
568
        return $this->branchType;
569
    }
570
571
    /**
572
     * Get lastSyncTransDate.
573
     *
574
     * @return \DateTime
575
     */
576
    public function getLastSyncTransDate()
577
    {
578
        return $this->lastSyncTransDate;
579
    }
580
581
    /**
582
     * Set lastSyncType.
583
     *
584
     * @param string $lastSyncType
585
     *
586
     * @return BranchSync
587
     */
588
    public function setLastSyncType($lastSyncType)
589
    {
590
        $this->lastSyncType = $lastSyncType;
591
592
        return $this;
593
    }
594
595
    /**
596
     * Get lastSyncType.
597
     *
598
     * @return string
599
     */
600
    public function getLastSyncType()
601
    {
602
        return $this->lastSyncType;
603
    }
604
605
    /**
606
     * Set lft.
607
     *
608
     * @param int $lft
609
     *
610
     * @return BranchSync
611
     */
612
    public function setLft($lft)
613
    {
614
        $this->lft = $lft;
615
616
        return $this;
617
    }
618
619
    /**
620
     * Get lft.
621
     *
622
     * @return int
623
     */
624
    public function getLft()
625
    {
626
        return $this->lft;
627
    }
628
629
    /**
630
     * Set rgt.
631
     *
632
     * @param int $rgt
633
     *
634
     * @return BranchSync
635
     */
636
    public function setRgt($rgt)
637
    {
638
        $this->rgt = $rgt;
639
640
        return $this;
641
    }
642
643
    /**
644
     * Get rgt.
645
     *
646
     * @return int
647
     */
648
    public function getRgt()
649
    {
650
        return $this->rgt;
651
    }
652
653
    /**
654
     * Set lvl.
655
     *
656
     * @param int $lvl
657
     *
658
     * @return BranchSync
659
     */
660
    public function setLvl($lvl)
661
    {
662
        $this->lvl = $lvl;
663
664
        return $this;
665
    }
666
667
    /**
668
     * Get lvl.
669
     *
670
     * @return int
671
     */
672
    public function getLvl()
673
    {
674
        return $this->lvl;
675
    }
676
677
    /**
678
     * Set root.
679
     *
680
     * @param int $root
681
     *
682
     * @return BranchSync
683
     */
684
    public function setRoot($root)
685
    {
686
        $this->root = $root;
687
688
        return $this;
689
    }
690
691
    /**
692
     * Get root.
693
     *
694
     * @return int
695
     */
696
    public function getRoot()
697
    {
698
        return $this->root;
699
    }
700
701
    /**
702
     * Set parentId.
703
     *
704
     * @param int $parentId
705
     *
706
     * @return BranchSync
707
     */
708
    public function setParentId($parentId)
709
    {
710
        $this->parentId = $parentId;
711
712
        return $this;
713
    }
714
715
    /**
716
     * Get parentId.
717
     *
718
     * @return int
719
     */
720
    public function getParentId()
721
    {
722
        return $this->parentId;
723
    }
724
725
    /**
726
     * @param BranchSync $parent
727
     *
728
     * @return $this
729
     */
730
    public function setParent(BranchSync $parent = null)
731
    {
732
        $this->parent = $parent;
733
734
        return $this;
735
    }
736
737
    /**
738
     * @return mixed
739
     */
740
    public function getParent()
741
    {
742
        return $this->parent;
743
    }
744
745
    /**
746
     * @return string
747
     */
748
    public function getUniqueId()
749
    {
750
        return $this->uniqueId;
751
    }
752
753
    /**
754
     * @param string $uniqueId
755
     *
756
     * @return $this
757
     */
758
    public function setUniqueId($uniqueId)
759
    {
760
        $this->uniqueId = $uniqueId;
761
762
        return $this;
763
    }
764
765
    /**
766
     * @return string
767
     */
768
    public function getDescription()
769
    {
770
        return $this->description;
771
    }
772
773
    /**
774
     * @param string $description
775
     *
776
     * @return BranchSync
777
     */
778
    public function setDescription($description)
779
    {
780
        $this->description = $description;
781
782
        return $this;
783
    }
784
}
785