Completed
Push — master ( 7564b6...a34f18 )
by Julito
23:49 queued 09:48
created

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