Completed
Push — master ( 467cb1...f6d530 )
by greg
57:09 queued 47:00
created

Game::getFbShare()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace PlaygroundGame\Entity;
3
4
use DateTime;
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Mapping\Annotation as Gedmo;
7
use Gedmo\Translatable\Translatable;
8
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
9
use Doctrine\ORM\Mapping\PrePersist;
10
use Doctrine\ORM\Mapping\PreUpdate;
11
use Doctrine\Common\Collections\ArrayCollection;
12
use Zend\InputFilter\InputFilter;
13
use Zend\InputFilter\Factory as InputFactory;
14
use Zend\InputFilter\InputFilterAwareInterface;
15
use Zend\InputFilter\InputFilterInterface;
16
17
/**
18
 * @ORM\Entity @HasLifecycleCallbacks
19
 *
20
 * @ORM\InheritanceType("JOINED")
21
 * @ORM\DiscriminatorColumn(name="type", type="string")
22
 * @ORM\DiscriminatorMap({"quiz" = "Quiz", "lottery" = "Lottery", "instantwin" =
23
 * "InstantWin", "postvote" = "PostVote", "mission" = "Mission", "tradingcard" = "TradingCard"})
24
 * @ORM\Table(name="game")
25
 * @Gedmo\TranslationEntity(class="PlaygroundGame\Entity\GameTranslation")
26
 */
27
abstract class Game implements InputFilterAwareInterface, Translatable, \JsonSerializable
28
{
29
    // not yet published
30
    const GAME_SCHEDULE  = 'scheduled';
31
    // published and not yet started
32
    const GAME_PUBLISHED  = 'published';
33
    // published and game in progress
34
    const GAME_IN_PROGRESS = 'in progress';
35
    // published and game finished
36
    const GAME_FINISHED   = 'finished';
37
    // closed
38
    const GAME_CLOSED = 'closed';
39
40
    /**
41
     * @Gedmo\Locale
42
     * Used locale to override Translation listener`s locale
43
     * this is not a mapped field of entity metadata, just a simple property
44
     */
45
    protected $locale;
46
47
    protected $inputFilter;
48
49
    /**
50
     * @ORM\Id
51
     * @ORM\Column(type="integer");
52
     * @ORM\GeneratedValue(strategy="AUTO")
53
     */
54
    protected $id;
55
56
    /**
57
     * @ORM\ManyToOne(targetEntity="\PlaygroundPartnership\Entity\Partner")
58
     */
59
    protected $partner;
60
61
    /**
62
     * Implementer ManyToOne(targetEntity="PrizeCategory") avec hydrator sur le formulaire
63
     * @ORM\Column(name="prize_category", type="integer", nullable=true)
64
     */
65
    protected $prizeCategory;
66
67
    /**
68
     * @Gedmo\Translatable
69
     * @ORM\Column(type="string", length=255, nullable=false)
70
     */
71
    protected $title;
72
73
    /**
74
     * @ORM\Column(type="string", length=255, unique=true, nullable=false)
75
     */
76
    protected $identifier;
77
78
    /**
79
     * @ORM\OneToOne(targetEntity="PlayerForm", mappedBy="game", cascade={"persist","remove"})
80
     **/
81
    protected $playerForm;
82
83
    /**
84
     * @ORM\Column(name="main_image", type="string", length=255, nullable=true)
85
     */
86
    protected $mainImage;
87
88
    /**
89
     * @ORM\Column(name="second_image", type="string", length=255, nullable=true)
90
     */
91
    protected $secondImage;
92
93
    /**
94
     * @ORM\Column(name="broadcast_facebook",type="boolean", nullable=true)
95
     */
96
    protected $broadcastFacebook = 0;
97
98
    /**
99
     * @ORM\Column(name="broadcast_platform",type="boolean", nullable=true)
100
     */
101
    protected $broadcastPlatform = 0;
102
103
    /**
104
     * @ORM\Column(type="string", length=255, nullable=true)
105
     */
106
    protected $domain = null;
107
108
    /**
109
     * @ORM\Column(name="broadcast_post_facebook",type="boolean", nullable=true)
110
     */
111
    protected $broadcastPostFacebook = 0;
112
113
    /**
114
     * @ORM\Column(name="push_home",type="boolean", nullable=true)
115
     */
116
    protected $pushHome = 0;
117
118
    /**
119
     * @ORM\Column(name="display_home",type="boolean", nullable=true)
120
     */
121
    protected $displayHome = 0;
122
123
    /**
124
     * @ORM\Column(name="mail_winner",type="boolean", nullable=true)
125
     */
126
    protected $mailWinner = 0;
127
128
    /**
129
     * @Gedmo\Translatable
130
     * @ORM\Column(name="mail_winner_block", type="text", nullable=true)
131
     */
132
    protected $mailWinnerBlock;
133
134
    /**
135
     * @ORM\Column(name="mail_looser",type="boolean", nullable=true)
136
     */
137
    protected $mailLooser = 0;
138
139
    /**
140
     * @Gedmo\Translatable
141
     * @ORM\Column(name="mail_looser_block", type="text", nullable=true)
142
     */
143
    protected $mailLooserBlock;
144
145
    /**
146
     * @ORM\Column(name="mail_entry",type="boolean", nullable=true)
147
     */
148
    protected $mailEntry = 0;
149
150
    /**
151
     * @ORM\Column(name="email_share",type="boolean", nullable=true)
152
     */
153
    protected $emailShare = 0;
154
155
    /**
156
     * @ORM\Column(name="fb_share",type="boolean", nullable=true)
157
     */
158
    protected $fbShare = 0;
159
160
    /**
161
     * @ORM\Column(name="tw_share",type="boolean", nullable=true)
162
     */
163
    protected $twShare = 0;
164
165
    /**
166
     * @ORM\Column(type="boolean", nullable=false)
167
     */
168
    protected $active = 0;
169
170
    /**
171
     * @ORM\Column(type="boolean", nullable=false)
172
     */
173
    protected $onInvitation = false;
174
175
    /**
176
     * @ORM\OneToMany(targetEntity="Invitation", mappedBy="game", cascade={"persist","remove"}, orphanRemoval=true)
177
     */
178
    private $invitations;
179
180
    /**
181
     * @ORM\Column(name="anonymous_allowed",type="boolean", nullable=true)
182
     */
183
    protected $anonymousAllowed = 0;
184
    
185
    /**
186
     * This column can be filled in when anonymousAllowed = 1.
187
     * If you put a value, it has to be a field key from playerdata. This key will
188
     * then be used to identify a player (generally 'email')
189
     *
190
     * @ORM\Column(name="anonymous_identifier", type="text", nullable=true)
191
     */
192
    protected $anonymousIdentifier;
193
194
    /**
195
     * @ORM\Column(name="publication_date", type="datetime", nullable=true)
196
     */
197
    protected $publicationDate;
198
199
    /**
200
     * @ORM\Column(name="start_date", type="datetime", nullable=true)
201
     */
202
    protected $startDate;
203
204
    /**
205
     * @ORM\Column(name="end_date", type="datetime", nullable=true)
206
     */
207
    protected $endDate;
208
209
    /**
210
     * @ORM\Column(name="close_date", type="datetime", nullable=true)
211
     */
212
    protected $closeDate;
213
214
    /**
215
     * play limitation. 0 : No limit
216
     *
217
     * @ORM\Column(name="play_limit", type="integer", nullable=false)
218
     */
219
    protected $playLimit = 0;
220
221
    /**
222
     * this field is taken into account only if playLimit<>0.
223
     * if 'always' only $playLimit play by person for this game
224
     * if 'day' only $playLimit play by person a day
225
     * if 'week' only $playLimit play by person a week
226
     * if 'month' only $playLimit play by person a month
227
     * if 'year' only $playLimit play by person a year
228
     *
229
     * @ORM\Column(name="play_limit_scale", type="string", nullable=true)
230
     */
231
    protected $playLimitScale;
232
233
    /**
234
     * this field is used for offering a complementary play entry
235
     * (for example, when the player share the game). The entries
236
     * of type 'bonus' won't be taken into account in the calaculation
237
     * of the authorized playLimit.
238
     *
239
     * if 'none' or null no play bonus is offered
240
     * if 'per_entry' a play bonus is offered for each entry
241
     * if 'one' only one play bonus is offered for every entries of the game
242
     *
243
     * @ORM\Column(name="play_bonus", type="string", nullable=true)
244
     */
245
    protected $playBonus;
246
247
    /**
248
     * @ORM\Column(type="string", length=255, nullable=true)
249
     */
250
    protected $layout;
251
252
    /**
253
     * @ORM\Column(type="string", length=255, nullable=true)
254
     */
255
    protected $stylesheet;
256
257
    /**
258
     * @Gedmo\Translatable
259
     * @ORM\Column(name="welcome_block", type="text", nullable=true)
260
     */
261
    protected $welcomeBlock;
262
263
    /**
264
     * @Gedmo\Translatable
265
     * @ORM\Column(type="text", nullable=true)
266
     */
267
    protected $termsBlock;
268
269
    /**
270
     * @ORM\Column(name="terms_optin", type="boolean", nullable=true)
271
     */
272
    protected $termsOptin = 0;
273
274
    /**
275
     * @Gedmo\Translatable
276
     * @ORM\Column(type="text", nullable=true)
277
     */
278
    protected $conditionsBlock;
279
280
    /**
281
     * @ORM\OneToMany(targetEntity="Prize", mappedBy="game", cascade={"persist","remove"}, orphanRemoval=true)
282
     */
283
    private $prizes;
284
285
    /**
286
     * @ORM\Column(name="fb_page_id", type="string", nullable=true)
287
     */
288
    protected $fbPageId;
289
290
    /**
291
     * @ORM\Column(name="fb_app_id", type="string", nullable=true)
292
     */
293
    protected $fbAppId;
294
295
    /**
296
     * @ORM\Column(name="fb_post_id", type="string", nullable=true)
297
     */
298
    protected $fbPostId;
299
300
    /**
301
     * @Gedmo\Translatable
302
     * @ORM\Column(name="fb_page_tab_title", type="string", length=255, nullable=true)
303
     */
304
    protected $fbPageTabTitle;
305
306
    /**
307
     * @ORM\Column(name="fb_page_tab_image", type="string", length=255, nullable=true)
308
     */
309
    protected $fbPageTabImage;
310
311
    /**
312
     * What is the tab's position. 0 : the highest
313
     *
314
     * @ORM\Column(name="fb_page_tab_position", type="integer", nullable=false)
315
     */
316
    protected $fbPageTabPosition = 0;
317
318
    /**
319
     * @Gedmo\Translatable
320
     * @ORM\Column(name="email_share_subject", type="text", nullable=true)
321
     */
322
    protected $emailShareSubject;
323
324
    /**
325
     * @Gedmo\Translatable
326
     * @ORM\Column(name="email_share_message", type="text", nullable=true)
327
     */
328
    protected $emailShareMessage;
329
330
    /**
331
     * @Gedmo\Translatable
332
     * @ORM\Column(name="fb_share_description", type="text", nullable=true)
333
     */
334
    protected $fbShareDescription;
335
336
    /**
337
     * @ORM\Column(name="fb_share_image", type="string", length=255, nullable=true)
338
     */
339
    protected $fbShareImage;
340
341
    /**
342
     * @Gedmo\Translatable
343
     * @ORM\Column(name="fb_request_message", type="text", nullable=true)
344
     */
345
    protected $fbRequestMessage;
346
347
    /**
348
     * @Gedmo\Translatable
349
     * @ORM\Column(name="tw_share_message", type="string", length=255, nullable=true)
350
     */
351
    protected $twShareMessage;
352
353
    /**
354
     * available steps : index, register, play, result, bounce
355
     * This string is transformed into an array and represents the workflow of the game
356
     * @ORM\Column(name="steps", type="string", length=255, nullable=true)
357
     */
358
    protected $steps = 'play,result';
359
360
    /**
361
     * @ORM\Column(name="steps_views", type="string", length=255, nullable=true)
362
     */
363
    protected $stepsViews = '{"index":{},"play":{},"result":{},"bounce":{}}';
364
365
    /**
366
     * Doctrine accessible value of discriminator (field 'type' is not
367
     * accessible through query)
368
     * And I want to be able to sort game collection based on type
369
     * http://www.doctrine-project.org/jira/browse/DDC-707
370
     * @ORM\Column(name="class_type", type="string", length=255, nullable=false)
371
     */
372
    protected $classType;
373
374
    /**
375
     * @ORM\Column(name="created_at", type="datetime")
376
     */
377
    protected $createdAt;
378
379
    /**
380
     * @ORM\Column(name="updated_at", type="datetime")
381
     */
382
    protected $updatedAt;
383
384
    public function __construct()
385
    {
386
        $this->prizes = new ArrayCollection();
387
        $this->invitations = new ArrayCollection();
388
    }
389
390
    /**
391
     * @PrePersist
392
     */
393
    public function createChrono()
394
    {
395
        $this->createdAt = new \DateTime("now");
396
        $this->updatedAt = new \DateTime("now");
397
    }
398
399
    /**
400
     * @PreUpdate
401
     */
402
    public function updateChrono()
403
    {
404
        $this->updatedAt = new \DateTime("now");
405
    }
406
407
    /**
408
     *
409
     * @return the $id
410
     */
411
    public function getId()
412
    {
413
        return $this->id;
414
    }
415
416
    /**
417
     *
418
     * @param field_type $id
419
     */
420
    public function setId($id)
421
    {
422
        $this->id = $id;
423
424
        return $this;
425
    }
426
427
    /**
428
     * @return the $playerForm
429
     */
430
    public function getPlayerForm()
431
    {
432
        return $this->playerForm;
433
    }
434
435
    /**
436
     * @param field_type $playerForm
437
     */
438
    public function setPlayerForm($playerForm)
439
    {
440
        $this->playerForm = $playerForm;
441
442
        return $this;
443
    }
444
445
    /**
446
     *
447
     * @return the unknown_type
448
     */
449
    public function getPartner()
450
    {
451
        return $this->partner;
452
    }
453
454
    /**
455
     *
456
     * @param unknown_type $partner
457
     */
458
    public function setPartner($partner)
459
    {
460
        $this->partner = $partner;
461
462
        return $this;
463
    }
464
465
    /**
466
     *
467
     * @param unknown_type $prizeCategory
468
     */
469
    public function setPrizeCategory($prizeCategory)
470
    {
471
        $this->prizeCategory = $prizeCategory;
472
473
        return $this;
474
    }
475
476
    /**
477
     *
478
     * @return the unknown_type
479
     */
480
    public function getPrizeCategory()
481
    {
482
        return $this->prizeCategory;
483
    }
484
485
    /**
486
     *
487
     * @return the $title
488
     */
489
    public function getTitle()
490
    {
491
        return $this->title;
492
    }
493
494
    /**
495
     *
496
     * @param field_type $title
497
     */
498
    public function setTitle($title)
499
    {
500
        $this->title = $title;
501
502
        return $this;
503
    }
504
505
    /**
506
     *
507
     * @return the $identifier
508
     */
509
    public function getIdentifier()
510
    {
511
        return $this->identifier;
512
    }
513
514
    /**
515
     *
516
     * @param field_type $identifier
517
     */
518
    public function setIdentifier($identifier)
519
    {
520
        $this->identifier = $identifier;
521
522
        return $this;
523
    }
524
525
    /**
526
     * @return integer $anonymousAllowed
527
     */
528
    public function getAnonymousAllowed()
529
    {
530
        return $this->anonymousAllowed;
531
    }
532
533
    /**
534
     * @param number $anonymousAllowed
535
     */
536
    public function setAnonymousAllowed($anonymousAllowed)
537
    {
538
        $this->anonymousAllowed = $anonymousAllowed;
0 ignored issues
show
Documentation Bug introduced by
It seems like $anonymousAllowed can also be of type double. However, the property $anonymousAllowed is declared as type integer. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
539
540
        return $this;
541
    }
542
543
    /**
544
     * @return the $anonymousIdentifier
545
     */
546
    public function getAnonymousIdentifier()
547
    {
548
        return $this->anonymousIdentifier;
549
    }
550
551
    /**
552
     * @param field_type $anonymousIdentifier
553
     */
554
    public function setAnonymousIdentifier($anonymousIdentifier)
555
    {
556
        $this->anonymousIdentifier = $anonymousIdentifier;
557
    }
558
559
    /**
560
     *
561
     * @return the $mainImage
562
     */
563
    public function getMainImage()
564
    {
565
        return $this->mainImage;
566
    }
567
568
    /**
569
     *
570
     * @param field_type $mainImage
571
     */
572
    public function setMainImage($mainImage)
573
    {
574
        $this->mainImage = $mainImage;
575
576
        return $this;
577
    }
578
579
    /**
580
     *
581
     * @return the $secondImage
582
     */
583
    public function getSecondImage()
584
    {
585
        return $this->secondImage;
586
    }
587
588
    /**
589
     *
590
     * @param field_type $secondImage
591
     */
592
    public function setSecondImage($secondImage)
593
    {
594
        $this->secondImage = $secondImage;
595
596
        return $this;
597
    }
598
599
    /**
600
     *
601
     * @return integer $broadcastFacebook
602
     */
603
    public function getBroadcastFacebook()
604
    {
605
        return $this->broadcastFacebook;
606
    }
607
608
    /**
609
     *
610
     * @param field_type $broadcastFacebook
611
     */
612
    public function setBroadcastFacebook($broadcastFacebook)
613
    {
614
        $this->broadcastFacebook = $broadcastFacebook;
0 ignored issues
show
Documentation Bug introduced by
It seems like $broadcastFacebook of type object<PlaygroundGame\Entity\field_type> is incompatible with the declared type integer of property $broadcastFacebook.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
615
616
        return $this;
617
    }
618
619
    /**
620
     *
621
     * @return integer $domain
622
     */
623
    public function getDomain()
624
    {
625
        return $this->domain;
626
    }
627
628
    /**
629
     *
630
     * @param field_type $domain
631
     */
632
    public function setDomain($domain)
633
    {
634
        $this->domain = $domain;
635
636
        return $this;
637
    }
638
639
    /**
640
     *
641
     * @return integer $broadcastPlatform
642
     */
643
    public function getBroadcastPlatform()
644
    {
645
        return $this->broadcastPlatform;
646
    }
647
648
    /**
649
     *
650
     * @param field_type $broadcastPlatform
651
     */
652
    public function setBroadcastPlatform($broadcastPlatform)
653
    {
654
        $this->broadcastPlatform = $broadcastPlatform;
0 ignored issues
show
Documentation Bug introduced by
It seems like $broadcastPlatform of type object<PlaygroundGame\Entity\field_type> is incompatible with the declared type integer of property $broadcastPlatform.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
655
656
        return $this;
657
    }
658
659
    /**
660
     * @return integer $broadcastPostFacebook
661
     */
662
    public function getBroadcastPostFacebook()
663
    {
664
        return $this->broadcastPostFacebook;
665
    }
666
667
    /**
668
     * @param number $broadcastPostFacebook
669
     */
670
    public function setBroadcastPostFacebook($broadcastPostFacebook)
671
    {
672
        $this->broadcastPostFacebook = $broadcastPostFacebook;
0 ignored issues
show
Documentation Bug introduced by
It seems like $broadcastPostFacebook can also be of type double. However, the property $broadcastPostFacebook is declared as type integer. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
673
674
        return $this;
675
    }
676
677
    /**
678
     * @return integer $mailWinner
679
     */
680
    public function getMailWinner()
681
    {
682
        return $this->mailWinner;
683
    }
684
685
    /**
686
     * @param number $mailWinner
687
     */
688
    public function setMailWinner($mailWinner)
689
    {
690
        $this->mailWinner = $mailWinner;
0 ignored issues
show
Documentation Bug introduced by
It seems like $mailWinner can also be of type double. However, the property $mailWinner is declared as type integer. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
691
    }
692
693
    /**
694
     * @return the $mailWinnerBlock
695
     */
696
    public function getMailWinnerBlock()
697
    {
698
        return $this->mailWinnerBlock;
699
    }
700
701
    /**
702
     * @param field_type $mailWinnerBlock
703
     */
704
    public function setMailWinnerBlock($mailWinnerBlock)
705
    {
706
        $this->mailWinnerBlock = $mailWinnerBlock;
707
    }
708
709
    /**
710
     * @return integer $mailEntry
711
     */
712
    public function getMailEntry()
713
    {
714
        return $this->mailEntry;
715
    }
716
717
    /**
718
     * @param number $mailEntry
719
     */
720
    public function setMailEntry($mailEntry)
721
    {
722
        $this->mailEntry = $mailEntry;
0 ignored issues
show
Documentation Bug introduced by
It seems like $mailEntry can also be of type double. However, the property $mailEntry is declared as type integer. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
723
    }
724
725
    /**
726
     * @return boolean $emailShare
727
     */
728
    public function getEmailShare()
729
    {
730
        return $this->emailShare;
731
    }
732
733
    /**
734
     * @param boolean $emailShare
735
     */
736
    public function setEmailShare($emailShare)
737
    {
738
        $this->emailShare = $emailShare;
0 ignored issues
show
Documentation Bug introduced by
The property $emailShare was declared of type integer, but $emailShare is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
739
    }
740
741
    /**
742
     * @return boolean $fbShare
743
     */
744
    public function getFbShare()
745
    {
746
        return $this->fbShare;
747
    }
748
749
    /**
750
     * @param boolean $fbShare
751
     */
752
    public function setFbShare($fbShare)
753
    {
754
        $this->fbShare = $fbShare;
0 ignored issues
show
Documentation Bug introduced by
The property $fbShare was declared of type integer, but $fbShare is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
755
    }
756
757
    /**
758
     * @return boolean $twShare
759
     */
760
    public function getTwShare()
761
    {
762
        return $this->twShare;
763
    }
764
765
    /**
766
     * @param boolean $twShare
767
     */
768
    public function setTwShare($twShare)
769
    {
770
        $this->twShare = $twShare;
0 ignored issues
show
Documentation Bug introduced by
The property $twShare was declared of type integer, but $twShare is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
771
    }
772
773
    /**
774
     * @return integer $mailLooser
775
     */
776
    public function getMailLooser()
777
    {
778
        return $this->mailLooser;
779
    }
780
781
    /**
782
     * @param number $mailLooser
783
     */
784
    public function setMailLooser($mailLooser)
785
    {
786
        $this->mailLooser = $mailLooser;
0 ignored issues
show
Documentation Bug introduced by
It seems like $mailLooser can also be of type double. However, the property $mailLooser is declared as type integer. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
787
    }
788
789
    /**
790
     * @return the $mailLooserBlock
791
     */
792
    public function getMailLooserBlock()
793
    {
794
        return $this->mailLooserBlock;
795
    }
796
797
    /**
798
     * @param field_type $mailLooserBlock
799
     */
800
    public function setMailLooserBlock($mailLooserBlock)
801
    {
802
        $this->mailLooserBlock = $mailLooserBlock;
803
    }
804
805
    /**
806
     *
807
     * @return integer $pushHome
808
     */
809
    public function getPushHome()
810
    {
811
        return $this->pushHome;
812
    }
813
814
    /**
815
     *
816
     * @param field_type $pushHome
817
     */
818
    public function setPushHome($pushHome)
819
    {
820
        $this->pushHome = $pushHome;
0 ignored issues
show
Documentation Bug introduced by
It seems like $pushHome of type object<PlaygroundGame\Entity\field_type> is incompatible with the declared type integer of property $pushHome.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
821
822
        return $this;
823
    }
824
825
    /**
826
     *
827
     * @return integer $displayHome
828
     */
829
    public function getDisplayHome()
830
    {
831
        return $this->displayHome;
832
    }
833
834
    /**
835
     *
836
     * @param field_type $displayHome
837
     */
838
    public function setDisplayHome($displayHome)
839
    {
840
        $this->displayHome = $displayHome;
0 ignored issues
show
Documentation Bug introduced by
It seems like $displayHome of type object<PlaygroundGame\Entity\field_type> is incompatible with the declared type integer of property $displayHome.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
841
842
        return $this;
843
    }
844
845
    /**
846
     *
847
     * @return the $publicationDate
848
     */
849
    public function getPublicationDate()
850
    {
851
        return $this->publicationDate;
852
    }
853
854
    /**
855
     *
856
     * @param field_type $publicationDate
857
     */
858
    public function setPublicationDate($publicationDate)
859
    {
860
        $this->publicationDate = $publicationDate;
861
862
        return $this;
863
    }
864
865
    /**
866
     *
867
     * @return the $startDate
868
     */
869
    public function getStartDate()
870
    {
871
        return $this->startDate;
872
    }
873
874
    /**
875
     *
876
     * @param field_type $startDate
877
     */
878
    public function setStartDate($startDate)
879
    {
880
        $this->startDate = $startDate;
881
882
        return $this;
883
    }
884
885
    /**
886
     *
887
     * @return the $endDate
888
     */
889
    public function getEndDate()
890
    {
891
        return $this->endDate;
892
    }
893
894
    /**
895
     *
896
     * @param field_type $endDate
897
     */
898
    public function setEndDate($endDate)
899
    {
900
        $this->endDate = $endDate;
901
902
        return $this;
903
    }
904
905
    /**
906
     *
907
     * @return the $closeDate
908
     */
909
    public function getCloseDate()
910
    {
911
        return $this->closeDate;
912
    }
913
914
    /**
915
     *
916
     * @param field_type $closeDate
917
     */
918
    public function setCloseDate($closeDate)
919
    {
920
        $this->closeDate = $closeDate;
921
922
        return $this;
923
    }
924
925
    public function isClosed()
926
    {
927
        $today = new DateTime('now');
928
        if (($this->getCloseDate() && $this->getCloseDate() < $today)
929
            ||
930
            ($this->getPublicationDate() && $this->getPublicationDate() > $today)
931
        ) {
932
            return true;
933
        }
934
935
        return false;
936
    }
937
938
    public function isOpen()
939
    {
940
        return !$this->isClosed();
941
    }
942
943 View Code Duplication
    public function isStarted()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
944
    {
945
        $today = new DateTime('now');
946
        if (((!$this->getStartDate() || $this->getStartDate() <= $today))
947
                &&
948
                (!$this->getEndDate() || $this->getEndDate() > $today)
949
        ) {
950
            return true;
951
        }
952
953
        return false;
954
    }
955
956 View Code Duplication
    public function isFinished()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
957
    {
958
        $today = new DateTime('now');
959
        if ($this->getEndDate() && $this->getEndDate() <= $today
960
            ||
961
            ($this->getCloseDate() && $this->getCloseDate() <= $today)
962
        ) {
963
            return true;
964
        }
965
966
        return false;
967
    }
968
969
    public function isOnline()
970
    {
971
        if ($this->getActive() && $this->getBroadcastPlatform()) {
972
            return true;
973
        }
974
975
        return false;
976
    }
977
978
    // json array : {"0":"index","1":"play","2":"result","3":"bounce"}
979
    public function getStepsArray()
980
    {
981
        $steps = null;
982
983
        if ($this->getSteps() && $this->getSteps()[0] === '{') {
984
            $steps = json_decode($this->getSteps(), true);
985
        } else if ($this->getSteps()) {
986
            $steps = explode(',', $this->getSteps());
987
        }
988
        if (!$steps) {
989
            $steps = array('index','play','result','bounce');
990
        }
991
        return $steps;
992
    }
993
994
995
996
    public function getStepsViewsArray()
997
    {
998
        $viewSteps = null;
999
1000
        if ($this->getStepsViews()) {
1001
            $viewSteps = json_decode($this->getStepsViews(), true);
1002
        }
1003
        if (!$viewSteps) {
1004
            $viewSteps = array('index','play','result','bounce');
1005
        }
1006
1007
        return $viewSteps;
1008
    }
1009
1010
    public function getSteps()
1011
    {
1012
        return $this->steps;
1013
    }
1014
1015
    public function setSteps($steps)
1016
    {
1017
        $this->steps = $steps;
1018
1019
        return $this;
1020
    }
1021
1022
    /**
1023
     * This method returns the first step in the game workflow
1024
     * @return string
1025
     */
1026
    public function firstStep()
1027
    {
1028
        $steps = $this->getStepsArray();
1029
1030
        return $steps[0];
1031
    }
1032
1033
    /**
1034
     * This method returns the last step in the game workflow
1035
     * @return string
1036
     */
1037
    public function lastStep()
1038
    {
1039
        $steps = $this->getStepsArray();
1040
        $nbSteps = count($steps);
1041
1042
        return $steps[$nbSteps-1];
1043
    }
1044
1045
    /**
1046
     * This method returns the previous step in the game workflow
1047
     * @param string $step
1048
     * @return string
1049
     */
1050 View Code Duplication
    public function previousStep($step = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
1051
    {
1052
        $steps = $this->getStepsArray();
1053
        $key = array_search($step, $steps);
1054
1055
        if (is_int($key) && $key > 0) {
1056
            return $steps[$key-1];
1057
        }
1058
1059
        return false;
0 ignored issues
show
Bug Best Practice introduced by
The return type of return false; (false) is incompatible with the return type documented by PlaygroundGame\Entity\Game::previousStep of type string.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
1060
    }
1061
1062
    /**
1063
     * This method returns the next step in the game workflow
1064
     * @param string $step
1065
     * @return string
1066
     */
1067 View Code Duplication
    public function nextStep($step = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
1068
    {
1069
        $steps = $this->getStepsArray();
1070
        $key = array_search($step, $steps);
1071
1072
        if (is_int($key) && $key < count($steps)-1) {
1073
            return $steps[$key+1];
1074
        }
1075
1076
        return false;
0 ignored issues
show
Bug Best Practice introduced by
The return type of return false; (false) is incompatible with the return type documented by PlaygroundGame\Entity\Game::nextStep of type string.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
1077
    }
1078
1079
    /**
1080
     * @return string $stepsViews
1081
     */
1082
    public function getStepsViews()
1083
    {
1084
        return $this->stepsViews;
1085
    }
1086
1087
    /**
1088
     * @param string $stepsViews
1089
     */
1090
    public function setStepsViews($stepsViews)
1091
    {
1092
        $this->stepsViews = $stepsViews;
1093
1094
        return $this;
1095
    }
1096
1097
    public function getState()
1098
    {
1099
        if ($this->isOpen()) {
1100
            if (!$this->isStarted() && !$this->isFinished()) {
1101
                return self::GAME_PUBLISHED;
1102
            } elseif ($this->isStarted()) {
1103
                return self::GAME_IN_PROGRESS;
1104
            } elseif ($this->isFinished()) {
1105
                return self::GAME_FINISHED;
1106
            }
1107
        } else {
1108
            if ($this->isFinished()) {
1109
                return self::GAME_CLOSED;
1110
            } else {
1111
                return self::GAME_SCHEDULE;
1112
            }
1113
        }
1114
    }
1115
1116
    /**
1117
     * @return integer unknown_type
1118
     */
1119
    public function getPlayLimit()
1120
    {
1121
        return $this->playLimit;
1122
    }
1123
1124
    /**
1125
     * @param unknown_type $playLimit
1126
     */
1127
    public function setPlayLimit($playLimit)
1128
    {
1129
        $this->playLimit = $playLimit;
0 ignored issues
show
Documentation Bug introduced by
It seems like $playLimit of type object<PlaygroundGame\Entity\unknown_type> is incompatible with the declared type integer of property $playLimit.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
1130
1131
        return $this;
1132
    }
1133
1134
    /**
1135
     * @return the unknown_type
1136
     */
1137
    public function getPlayLimitScale()
1138
    {
1139
        return $this->playLimitScale;
1140
    }
1141
1142
    /**
1143
     * @param unknown_type $playLimitScale
1144
     */
1145
    public function setPlayLimitScale($playLimitScale)
1146
    {
1147
        $this->playLimitScale = $playLimitScale;
1148
1149
        return $this;
1150
    }
1151
1152
    /**
1153
     * @return the unknown_type
1154
     */
1155
    public function getPlayBonus()
1156
    {
1157
        return $this->playBonus;
1158
    }
1159
1160
    /**
1161
     * @param unknown_type $playBonus
1162
     */
1163
    public function setPlayBonus($playBonus)
1164
    {
1165
        $this->playBonus = $playBonus;
1166
1167
        return $this;
1168
    }
1169
1170
    /**
1171
     *
1172
     * @return the $layout
1173
     */
1174
    public function getLayout()
1175
    {
1176
        return $this->layout;
1177
    }
1178
1179
    /**
1180
     *
1181
     * @param field_type $layout
1182
     */
1183
    public function setLayout($layout)
1184
    {
1185
        $this->layout = $layout;
1186
1187
        return $this;
1188
    }
1189
1190
    /**
1191
     *
1192
     * @return the $stylesheet
1193
     */
1194
    public function getStylesheet()
1195
    {
1196
        return $this->stylesheet;
1197
    }
1198
1199
    /**
1200
     *
1201
     * @param field_type $stylesheet
1202
     */
1203
    public function setStylesheet($stylesheet)
1204
    {
1205
        $this->stylesheet = $stylesheet;
1206
1207
        return $this;
1208
    }
1209
1210
    /**
1211
     *
1212
     * @return the $welcomeBlock
1213
     */
1214
    public function getWelcomeBlock()
1215
    {
1216
        return $this->welcomeBlock;
1217
    }
1218
1219
    /**
1220
     *
1221
     * @param field_type $welcomeBlock
1222
     */
1223
    public function setWelcomeBlock($welcomeBlock)
1224
    {
1225
        $this->welcomeBlock = $welcomeBlock;
1226
1227
        return $this;
1228
    }
1229
1230
    /**
1231
     *
1232
     * @return the $termsBlock
1233
     */
1234
    public function getTermsBlock()
1235
    {
1236
        return $this->termsBlock;
1237
    }
1238
1239
    /**
1240
     *
1241
     * @param text $termsBlock
1242
     */
1243
    public function setTermsBlock($termsBlock)
1244
    {
1245
        $this->termsBlock = $termsBlock;
1246
1247
        return $this;
1248
    }
1249
1250
    /**
1251
     *
1252
     * @return integer $termsOptin
1253
     */
1254
    public function getTermsOptin()
1255
    {
1256
        return $this->termsOptin;
1257
    }
1258
1259
    /**
1260
     *
1261
     * @param text $termsOptin
1262
     */
1263
    public function setTermsOptin($termsOptin)
1264
    {
1265
        $this->termsOptin = $termsOptin;
0 ignored issues
show
Documentation Bug introduced by
It seems like $termsOptin of type object<PlaygroundGame\Entity\text> is incompatible with the declared type integer of property $termsOptin.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
1266
1267
        return $this;
1268
    }
1269
1270
    /**
1271
     *
1272
     * @return the $conditionsBlock
1273
     */
1274
    public function getConditionsBlock()
1275
    {
1276
        return $this->conditionsBlock;
1277
    }
1278
1279
    /**
1280
     *
1281
     * @param text $conditionsBlock
1282
     */
1283
    public function setConditionsBlock($conditionsBlock)
1284
    {
1285
        $this->conditionsBlock = $conditionsBlock;
1286
1287
        return $this;
1288
    }
1289
1290
    /**
1291
     * @return ArrayCollection unknown_type
1292
     */
1293
    public function getPrizes()
1294
    {
1295
        return $this->prizes;
1296
    }
1297
1298
    /**
1299
     * frm collection solution
1300
     * @param ArrayCollection $prizes
1301
     */
1302
    public function setPrizes(ArrayCollection $prizes)
1303
    {
1304
        $this->prizes = $prizes;
1305
1306
        return $this;
1307
    }
1308
1309
    public function addPrizes(ArrayCollection $prizes)
1310
    {
1311
        foreach ($prizes as $prize) {
1312
            $prize->setGame($this);
1313
            $this->prizes->add($prize);
1314
        }
1315
    }
1316
1317
1318
    public function removePrizes(ArrayCollection $prizes)
1319
    {
1320
        foreach ($prizes as $prize) {
1321
            $prize->setGame(null);
1322
            $this->prizes->removeElement($prize);
1323
        }
1324
    }
1325
1326
    /**
1327
     * Add a prize to the game.
1328
     *
1329
     * @param Prize $prize
1330
     *
1331
     * @return void
1332
     */
1333
    public function addPrize($prize)
1334
    {
1335
        $this->prizes[] = $prize;
1336
    }
1337
1338
    /**
1339
     *
1340
     * @return string $classType
1341
     */
1342
    public function getClassType()
1343
    {
1344
        return $this->classType;
1345
    }
1346
1347
    /**
1348
     *
1349
     * @param string classType
1350
     * @param string $classType
1351
     */
1352
    public function setClassType($classType)
1353
    {
1354
        $this->classType = $classType;
1355
1356
        return $this;
1357
    }
1358
1359
    /**
1360
     *
1361
     * @return integer unknown_type
1362
     */
1363
    public function getActive()
1364
    {
1365
        return $this->active;
1366
    }
1367
1368
    /**
1369
     *
1370
     * @param unknown_type $active
1371
     */
1372
    public function setActive($active)
1373
    {
1374
        $this->active = $active;
0 ignored issues
show
Documentation Bug introduced by
It seems like $active of type object<PlaygroundGame\Entity\unknown_type> is incompatible with the declared type integer of property $active.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
1375
1376
        return $this;
1377
    }
1378
1379
    /**
1380
     *
1381
     * @return boolean $onInvitation
1382
     */
1383
    public function getOnInvitation()
1384
    {
1385
        return $this->onInvitation;
1386
    }
1387
1388
    /**
1389
     *
1390
     * @param boolean $onInvitation
1391
     */
1392
    public function setOnInvitation($onInvitation)
1393
    {
1394
        $this->onInvitation = $onInvitation;
1395
1396
        return $this;
1397
    }
1398
1399
    /**
1400
     * @return ArrayCollection unknown_type
1401
     */
1402
    public function getInvitations()
1403
    {
1404
        return $this->invitations;
1405
    }
1406
1407
    /**
1408
     * @param ArrayCollection $invitations
1409
     */
1410
    public function setInvitations(ArrayCollection $invitations)
1411
    {
1412
        $this->invitations = $invitations;
1413
1414
        return $this;
1415
    }
1416
1417
    public function addInvitations(ArrayCollection $invitations)
1418
    {
1419
        foreach ($invitations as $invitation) {
1420
            $invitation->setGame($this);
1421
            $this->invitations->add($invitation);
1422
        }
1423
    }
1424
1425
    public function removeInvitations(ArrayCollection $invitations)
1426
    {
1427
        foreach ($invitations as $invitation) {
1428
            $prize->setGame(null);
0 ignored issues
show
Bug introduced by
The variable $prize does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
1429
            $this->invitations->removeElement($invitation);
1430
        }
1431
    }
1432
1433
    /**
1434
     * Add an invitation to the game.
1435
     *
1436
     * @param Invitation $invitation
1437
     *
1438
     * @return void
1439
     */
1440
    public function addInvitation($invitation)
1441
    {
1442
        $this->invitations[] = $invitation;
1443
    }
1444
1445
1446
    /**
1447
     *
1448
     * @return string the Facebook app_id
1449
     */
1450
    public function getFbPageId()
1451
    {
1452
        return $this->fbPageId;
1453
    }
1454
1455
    /**
1456
     *
1457
     * @param string $fbPageId
1458
     */
1459
    public function setFbPageId($fbPageId)
1460
    {
1461
        $this->fbPageId = $fbPageId;
1462
1463
        return $this;
1464
    }
1465
1466
    /**
1467
     *
1468
     * @return string the Facebook app_id
1469
     */
1470
    public function getFbAppId()
1471
    {
1472
        return $this->fbAppId;
1473
    }
1474
1475
    /**
1476
     *
1477
     * @param string $fbAppId
1478
     */
1479
    public function setFbAppId($fbAppId)
1480
    {
1481
        $this->fbAppId = $fbAppId;
1482
1483
        return $this;
1484
    }
1485
1486
    /**
1487
     *
1488
     * @return string the Facebook app_id
1489
     */
1490
    public function getFbPostId()
1491
    {
1492
        return $this->fbPostId;
1493
    }
1494
1495
    /**
1496
     *
1497
     * @param string $fbPostId
1498
     */
1499
    public function setFbPostId($fbPostId)
1500
    {
1501
        $this->fbPostId = $fbPostId;
1502
1503
        return $this;
1504
    }
1505
1506
    /**
1507
     *
1508
     * @return string the Facebook fbPageTabTitle
1509
     */
1510
    public function getFbPageTabTitle()
1511
    {
1512
        return $this->fbPageTabTitle;
1513
    }
1514
1515
    /**
1516
     *
1517
     * @param string $fbPageTabTitle
1518
     */
1519
    public function setFbPageTabTitle($fbPageTabTitle)
1520
    {
1521
        $this->fbPageTabTitle = $fbPageTabTitle;
1522
1523
        return $this;
1524
    }
1525
1526
    /**
1527
     *
1528
     * @return string the Facebook fbPageTabImage
1529
     */
1530
    public function getFbPageTabImage()
1531
    {
1532
        return $this->fbPageTabImage;
1533
    }
1534
1535
    /**
1536
     *
1537
     * @param string $fbPageTabImage
1538
     */
1539
    public function setFbPageTabImage($fbPageTabImage)
1540
    {
1541
        $this->fbPageTabImage = $fbPageTabImage;
1542
1543
        return $this;
1544
    }
1545
1546
    /**
1547
     *
1548
     * @return string the Facebook fbPageTabPosition
1549
     */
1550
    public function getFbPageTabPosition()
1551
    {
1552
        return $this->fbPageTabPosition;
1553
    }
1554
1555
    /**
1556
     *
1557
     * @param string $fbPageTabPosition
1558
     */
1559
    public function setFbPageTabPosition($fbPageTabPosition)
1560
    {
1561
        $this->fbPageTabPosition = $fbPageTabPosition;
0 ignored issues
show
Documentation Bug introduced by
The property $fbPageTabPosition was declared of type integer, but $fbPageTabPosition is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
1562
1563
        return $this;
1564
    }
1565
1566
    /**
1567
     *
1568
     * @return the string
1569
     */
1570
    public function getEmailShareSubject()
1571
    {
1572
        return $this->emailShareSubject;
1573
    }
1574
1575
    /**
1576
     *
1577
     * @param string $emailShareSubject
1578
     */
1579
    public function setEmailShareSubject($emailShareSubject)
1580
    {
1581
        $this->emailShareSubject = $emailShareSubject;
1582
1583
        return $this;
1584
    }
1585
1586
    /**
1587
     *
1588
     * @return the unknown_type
1589
     */
1590
    public function getEmailShareMessage()
1591
    {
1592
        return $this->emailShareMessage;
1593
    }
1594
1595
    /**
1596
     *
1597
     * @param unknown_type $emailShareMessage
1598
     */
1599
    public function setEmailShareMessage($emailShareMessage)
1600
    {
1601
        $this->emailShareMessage = $emailShareMessage;
1602
1603
        return $this;
1604
    }
1605
1606
    /**
1607
     *
1608
     * @return the string
1609
     */
1610
    public function getFbShareDescription()
1611
    {
1612
        return $this->fbShareDescription;
1613
    }
1614
1615
    /**
1616
     *
1617
     * @param string $fbShareDescription
1618
     */
1619
    public function setFbShareDescription($fbShareDescription)
1620
    {
1621
        $this->fbShareDescription = $fbShareDescription;
1622
1623
        return $this;
1624
    }
1625
1626
    /**
1627
     *
1628
     * @return the unknown_type
1629
     */
1630
    public function getFbShareImage()
1631
    {
1632
        return $this->fbShareImage;
1633
    }
1634
1635
    /**
1636
     *
1637
     * @param unknown_type $fbShareImage
1638
     */
1639
    public function setFbShareImage($fbShareImage)
1640
    {
1641
        $this->fbShareImage = $fbShareImage;
1642
1643
        return $this;
1644
    }
1645
1646
    /**
1647
     *
1648
     * @return string unknown_type
1649
     */
1650
    public function getFbRequestMessage()
1651
    {
1652
        return $this->fbRequestMessage;
1653
    }
1654
1655
    /**
1656
     *
1657
     * @param unknown_type $fbRequestMessage
1658
     */
1659
    public function setFbRequestMessage($fbRequestMessage)
1660
    {
1661
        $this->fbRequestMessage = $fbRequestMessage;
1662
1663
        return $this;
1664
    }
1665
1666
    /**
1667
     *
1668
     * @return the unknown_type
1669
     */
1670
    public function getTwShareMessage()
1671
    {
1672
        return $this->twShareMessage;
1673
    }
1674
1675
    /**
1676
     *
1677
     * @param unknown_type $twShareMessage
1678
     */
1679
    public function setTwShareMessage($twShareMessage)
1680
    {
1681
        $this->twShareMessage = $twShareMessage;
1682
1683
        return $this;
1684
    }
1685
1686
    /**
1687
     *
1688
     * @return DateTime $createdAt
1689
     */
1690
    public function getCreatedAt()
1691
    {
1692
        return $this->createdAt;
1693
    }
1694
1695
    /**
1696
     *
1697
     * @param \DateTime $createdAt
1698
     */
1699
    public function setCreatedAt($createdAt)
1700
    {
1701
        $this->createdAt = $createdAt;
1702
1703
        return $this;
1704
    }
1705
1706
    /**
1707
     *
1708
     * @return DateTime $updatedAt
1709
     */
1710
    public function getUpdatedAt()
1711
    {
1712
        return $this->updatedAt;
1713
    }
1714
1715
    /**
1716
     *
1717
     * @param \DateTime $updatedAt
1718
     */
1719
    public function setUpdatedAt($updatedAt)
1720
    {
1721
        $this->updatedAt = $updatedAt;
1722
1723
        return $this;
1724
    }
1725
1726
    /**
1727
     * Convert the object to an array.
1728
     *
1729
     * @return array
1730
     */
1731
    public function getArrayCopy()
1732
    {
1733
        $obj_vars = get_object_vars($this);
1734
1735 View Code Duplication
        if (isset($obj_vars['publicationDate']) && $obj_vars['publicationDate'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
1736
            $obj_vars['publicationDate'] = $obj_vars['publicationDate']->format('d/m/Y H:i:s');
1737
        }
1738 View Code Duplication
        if (isset($obj_vars['endDate']) && $obj_vars['endDate'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
1739
            $obj_vars['endDate'] = $obj_vars['endDate']->format('d/m/Y H:i:s');
1740
        }
1741 View Code Duplication
        if (isset($obj_vars['startDate']) && $obj_vars['startDate'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
1742
            $obj_vars['startDate'] = $obj_vars['startDate']->format('d/m/Y H:i:s');
1743
        }
1744
1745
        return $obj_vars;
1746
    }
1747
1748
    /**
1749
     * Convert the object to json.
1750
     *
1751
     * @return array
1752
     */
1753
    public function jsonSerialize()
1754
    {
1755
        return $this->getArrayCopy();
1756
    }
1757
1758
    /**
1759
     * Populate from an array.
1760
     *
1761
     * @param array $data
1762
     */
1763
    public function populate($data = array())
1764
    {
1765
        if (isset($data['partner']) && $data['partner'] !== null) {
1766
            $this->partner = $data['partner'];
1767
        }
1768
1769
        $this->title = (isset($data['title'])) ? $data['title'] : null;
1770
        $this->type = (isset($data['type']) && $data['type'] !== null) ? $data['type'] : null;
0 ignored issues
show
Bug introduced by
The property type does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
1771
1772
        if (isset($data['mainImage']) && $data['mainImage'] !== null) {
1773
            $this->mainImage = $data['mainImage'];
1774
        }
1775
1776
        if (isset($data['secondImage']) && $data['secondImage'] !== null) {
1777
            $this->secondImage = $data['secondImage'];
1778
        }
1779
1780 View Code Duplication
        if (isset($data['active']) && $data['active'] !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
1781
            $this->active = $data['active'];
1782
        }
1783
1784
        $this->layout           = (isset($data['layout'])) ? $data['layout'] : null;
1785
        $this->stylesheet       = (isset($data['stylesheet'])) ? $data['stylesheet'] : null;
1786
1787
        $this->pushHome         = (isset($data['pushHome']) && $data['pushHome'] !== null) ? $data['pushHome'] : 0;
1788
        $this->displayHome      = (isset($data['displayHome']) && $data['displayHome'] !== null) ?
1789
            $data['displayHome'] :
1790
            0;
1791
        $this->prizeCategory   = (isset($data['prizeCategory'])) ? $data['prizeCategory'] : null;
1792
1793
        $this->publicationDate  = (isset($data['publicationDate']) && $data['publicationDate'] !== null) ?
1794
            DateTime::createFromFormat('d/m/Y', $data['publicationDate']) :
1795
            null;
1796
        $this->endDate         = (isset($data['endDate']) && $data['endDate'] !== null) ?
1797
            DateTime::createFromFormat('d/m/Y', $data['endDate']) :
1798
            null;
1799
        $this->startDate       = (isset($data['startDate']) && $data['startDate'] !== null) ?
1800
            DateTime::createFromFormat('d/m/Y', $data['startDate']) :
1801
            null;
1802
1803
        $this->identifier       = (isset($data['identifier'])) ? $data['identifier'] : null;
1804
        $this->welcomeBlock    = (isset($data['welcomeBlock'])) ? $data['welcomeBlock'] : null;
1805
        $this->termsBlock       = (isset($data['termsBlock'])) ? $data['termsBlock'] : null;
1806
        $this->conditionsBlock  = (isset($data['conditionsBlock'])) ? $data['conditionsBlock'] : null;
1807
1808
        $this->fbShareDescription   = (isset($data['fbShareDescription'])) ? $data['fbShareDescription'] : null;
1809
        $this->fbShareImage     = (isset($data['fbShareImage'])) ? $data['fbShareImage'] : null;
1810
        $this->fbRequestMessage = (isset($data['fbRequestMessage'])) ? $data['fbRequestMessage'] : null;
1811
        $this->twShareMessage   = (isset($data['twShareMessage'])) ? $data['twShareMessage'] : null;
1812
        $this->emailSubjectMessage   = (isset($data['emailSubjectMessage'])) ? $data['emailSubjectMessage'] : null;
0 ignored issues
show
Bug introduced by
The property emailSubjectMessage does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
1813
        $this->emailShareMessage   = (isset($data['emailShareMessage'])) ? $data['emailShareMessage'] : null;
1814
    }
1815
1816
    public function setInputFilter(InputFilterInterface $inputFilter)
1817
    {
1818
        throw new \Exception("Not used");
1819
    }
1820
1821
    public function getInputFilter()
1822
    {
1823
        if (! $this->inputFilter) {
1824
            $inputFilter = new InputFilter();
1825
            $factory = new InputFactory();
1826
1827
            $inputFilter->add($factory->createInput(array(
1828
                'name' => 'id',
1829
                'required' => true,
1830
                'filters' => array(
1831
                    array(
1832
                        'name' => 'Int'
1833
                    )
1834
                )
1835
            )));
1836
1837
            $inputFilter->add($factory->createInput(array(
1838
                'name' => 'partner',
1839
                'required' => false
1840
            )));
1841
1842
            $inputFilter->add($factory->createInput(array(
1843
                'name' => 'fbAppId',
1844
                'required' => false
1845
            )));
1846
1847
            $inputFilter->add($factory->createInput(array(
1848
                'name' => 'fbPageId',
1849
                'required' => false
1850
            )));
1851
1852
            $inputFilter->add($factory->createInput(array(
1853
                'name' => 'fbPostId',
1854
                'required' => false
1855
            )));
1856
1857
            $inputFilter->add($factory->createInput(array(
1858
                'name' => 'prizes',
1859
                'required' => false
1860
            )));
1861
1862
            $inputFilter->add($factory->createInput(array(
1863
                'name' => 'invitations',
1864
                'required' => false
1865
            )));
1866
1867
            $inputFilter->add($factory->createInput(array(
1868
                'name' => 'title',
1869
                'required' => true,
1870
                'filters' => array(
1871
                    array(
1872
                        'name' => 'StripTags'
1873
                    ),
1874
                    array(
1875
                        'name' => 'StringTrim'
1876
                    )
1877
                ),
1878
                'validators' => array(
1879
                    array(
1880
                        'name' => 'StringLength',
1881
                        'options' => array(
1882
                            'encoding' => 'UTF-8',
1883
                            'min' => 5,
1884
                            'max' => 255
1885
                        )
1886
                    )
1887
                )
1888
            )));
1889
1890
            $inputFilter->add($factory->createInput(array(
1891
                'name' => 'publicationDate',
1892
                'required' => false,
1893
            )));
1894
1895
            $inputFilter->add($factory->createInput(array(
1896
                'name' => 'startDate',
1897
                'required' => false,
1898
            )));
1899
1900
            $inputFilter->add($factory->createInput(array(
1901
                'name' => 'endDate',
1902
                'required' => false,
1903
            )));
1904
1905
            $inputFilter->add($factory->createInput(array(
1906
               'name' => 'closeDate',
1907
               'required' => false,
1908
            )));
1909
1910
            $inputFilter->add($factory->createInput(array(
1911
                'name' => 'termsOptin',
1912
                'required' => false,
1913
            )));
1914
1915
            $inputFilter->add($factory->createInput(array(
1916
                'name' => 'identifier',
1917
                'required' => true,
1918
                'filters' => array(
1919
                    array(
1920
                        'name' => 'StripTags'
1921
                    ),
1922
                    array(
1923
                        'name' => 'StringTrim'
1924
                    ),
1925
                    array(
1926
                        'name' => 'PlaygroundCore\Filter\Slugify'
1927
                    )
1928
                ),
1929
                'validators' => array(
1930
                    array(
1931
                        'name' => 'StringLength',
1932
                        'options' => array(
1933
                            'encoding' => 'UTF-8',
1934
                            'min' => 3,
1935
                            'max' => 255
1936
                        )
1937
                    )
1938
                )
1939
            )));
1940
1941
            $inputFilter->add($factory->createInput(array(
1942
                'name'     => 'playLimit',
1943
                'required' => false,
1944
                'validators' => array(
1945
                    array(
1946
                        'name'    => 'Between',
1947
                        'options' => array(
1948
                            'min'      => 0,
1949
                            'max'      => 999999,
1950
                        ),
1951
                    ),
1952
                ),
1953
            )));
1954
1955
            $inputFilter->add($factory->createInput(array(
1956
                'name' => 'playLimitScale',
1957
                'required' => false,
1958
                'validators' => array(
1959
                    array(
1960
                        'name' => 'InArray',
1961
                        'options' => array(
1962
                            'haystack' => array('day', 'week', 'month', 'year', 'always'),
1963
                        ),
1964
                    ),
1965
                ),
1966
            )));
1967
1968
            $inputFilter->add($factory->createInput(array(
1969
                'name' => 'playBonus',
1970
                'required' => false,
1971
                'validators' => array(
1972
                    array(
1973
                        'name' => 'InArray',
1974
                        'options' => array(
1975
                            'haystack' => array('none', 'per_entry', 'one'),
1976
                        ),
1977
                    ),
1978
                ),
1979
            )));
1980
1981
            $inputFilter->add($factory->createInput(array(
1982
                'name' => 'active',
1983
                'required' => true
1984
            )));
1985
1986
            $inputFilter->add($factory->createInput(array(
1987
                'name' => 'onInvitation',
1988
                'required' => false
1989
            )));
1990
1991
            $inputFilter->add($factory->createInput(array(
1992
                'name' => 'displayHome',
1993
                'required' => false
1994
            )));
1995
1996
            $inputFilter->add($factory->createInput(array(
1997
                'name' => 'pushHome',
1998
                'required' => false
1999
            )));
2000
2001
            $inputFilter->add($factory->createInput(array(
2002
                'name' => 'anonymousAllowed',
2003
                'required' => false
2004
            )));
2005
2006
            $inputFilter->add($factory->createInput(array(
2007
                'name' => 'mailWinner',
2008
                'required' => false
2009
            )));
2010
2011
            $inputFilter->add($factory->createInput(array(
2012
                'name' => 'mailLooser',
2013
                'required' => false
2014
            )));
2015
2016
            $inputFilter->add($factory->createInput(array(
2017
                'name' => 'mailEntry',
2018
                'required' => false
2019
            )));
2020
2021
            $inputFilter->add($factory->createInput(array(
2022
                'name' => 'emailShare',
2023
                'required' => false
2024
            )));
2025
2026
            $inputFilter->add($factory->createInput(array(
2027
                'name' => 'fbShare',
2028
                'required' => false
2029
            )));
2030
2031
            $inputFilter->add($factory->createInput(array(
2032
                'name' => 'twShare',
2033
                'required' => false
2034
            )));
2035
2036
            $inputFilter->add($factory->createInput(array(
2037
                'name' => 'prizeCategory',
2038
                'required' => false,
2039
                'filters' => array(
2040
                    array(
2041
                        'name' => 'Int'
2042
                    )
2043
                )
2044
            )));
2045
2046
            $inputFilter->add($factory->createInput(array(
2047
                'name' => 'fbPageTabTitle',
2048
                'required' => false
2049
            )));
2050
2051
            $inputFilter->add($factory->createInput(array(
2052
                'name' => 'fbPageTabImage',
2053
                'required' => false
2054
            )));
2055
            $inputFilter->add($factory->createInput(array(
2056
                'name' => 'fbPageTabPosition',
2057
                'required' => false
2058
            )));
2059
2060
            $inputFilter->add($factory->createInput(array(
2061
                'name' => 'layout',
2062
                'required' => false,
2063
                'filters' => array(
2064
                    array(
2065
                        'name' => 'StripTags'
2066
                    ),
2067
                    array(
2068
                        'name' => 'StringTrim'
2069
                    )
2070
                ),
2071
                'validators' => array(
2072
                    array(
2073
                        'name' => 'StringLength',
2074
                        'options' => array(
2075
                            'encoding' => 'UTF-8',
2076
                            'min' => 0,
2077
                            'max' => 255
2078
                        )
2079
                    )
2080
                )
2081
            )));
2082
2083
            $inputFilter->add($factory->createInput(array(
2084
                'name' => 'stylesheet',
2085
                'required' => false,
2086
                'filters' => array(
2087
                    array(
2088
                        'name' => 'StripTags'
2089
                    ),
2090
                    array(
2091
                        'name' => 'StringTrim'
2092
                    )
2093
                ),
2094
                'validators' => array(
2095
                    array(
2096
                        'name' => 'StringLength',
2097
                        'options' => array(
2098
                            'encoding' => 'UTF-8',
2099
                            'min' => 0,
2100
                            'max' => 255
2101
                        )
2102
                    )
2103
                )
2104
            )));
2105
2106
            $inputFilter->add($factory->createInput(array(
2107
                'name' => 'fbShareImage',
2108
                'required' => false,
2109
                'filters' => array(
2110
                    array(
2111
                        'name' => 'StripTags'
2112
                    ),
2113
                    array(
2114
                        'name' => 'StringTrim'
2115
                    )
2116
                ),
2117
                'validators' => array(
2118
                    array(
2119
                        'name' => 'StringLength',
2120
                        'options' => array(
2121
                            'encoding' => 'UTF-8',
2122
                            'min' => 1,
2123
                            'max' => 255
2124
                        )
2125
                    )
2126
                )
2127
            )));
2128
2129
            $inputFilter->add($factory->createInput(array(
2130
                'name' => 'emailSubjectMessage',
2131
                'required' => false,
2132
                'filters' => array(
2133
                    array(
2134
                            'name' => 'StripTags'
2135
                    ),
2136
                    array(
2137
                            'name' => 'StringTrim'
2138
                    )
2139
                ),
2140
                'validators' => array(
2141
                    array(
2142
                        'name' => 'StringLength',
2143
                        'options' => array(
2144
                            'encoding' => 'UTF-8',
2145
                            'min' => 1,
2146
                            'max' => 500
2147
                        )
2148
                    )
2149
                )
2150
            )));
2151
2152
            $inputFilter->add($factory->createInput(array(
2153
                'name' => 'emailShareMessage',
2154
                'required' => false,
2155
                'filters' => array(
2156
                    array(
2157
                            'name' => 'StripTags'
2158
                    ),
2159
                    array(
2160
                            'name' => 'StringTrim'
2161
                    )
2162
                ),
2163
                'validators' => array(
2164
                    array(
2165
                        'name' => 'StringLength',
2166
                        'options' => array(
2167
                            'encoding' => 'UTF-8',
2168
                            'min' => 1,
2169
                            'max' => 500
2170
                        )
2171
                    )
2172
                )
2173
            )));
2174
2175
            $inputFilter->add($factory->createInput(array(
2176
                'name' => 'fbShareDescription',
2177
                'required' => false,
2178
                'filters' => array(
2179
                        array(
2180
                                'name' => 'StripTags'
2181
                        ),
2182
                        array(
2183
                                'name' => 'StringTrim'
2184
                        )
2185
                ),
2186
                'validators' => array(
2187
                    array(
2188
                        'name' => 'StringLength',
2189
                        'options' => array(
2190
                            'encoding' => 'UTF-8',
2191
                            'min' => 1,
2192
                            'max' => 500
2193
                            )
2194
                    )
2195
                )
2196
            )));
2197
2198
            $inputFilter->add($factory->createInput(array(
2199
                'name' => 'fbRequestMessage',
2200
                'required' => false,
2201
                'filters' => array(
2202
                    array(
2203
                        'name' => 'StripTags'
2204
                    ),
2205
                    array(
2206
                        'name' => 'StringTrim'
2207
                    )
2208
                ),
2209
                'validators' => array(
2210
                    array(
2211
                        'name' => 'StringLength',
2212
                        'options' => array(
2213
                            'encoding' => 'UTF-8',
2214
                            'min' => 1,
2215
                            'max' => 500
2216
                        )
2217
                    )
2218
                )
2219
            )));
2220
2221
            $inputFilter->add($factory->createInput(array(
2222
                'name' => 'twShareMessage',
2223
                'required' => false,
2224
                'filters' => array(
2225
                    array(
2226
                        'name' => 'StripTags'
2227
                    ),
2228
                    array(
2229
                        'name' => 'StringTrim'
2230
                    )
2231
                ),
2232
                'validators' => array(
2233
                    array(
2234
                        'name' => 'StringLength',
2235
                        'options' => array(
2236
                            'encoding' => 'UTF-8',
2237
                            'min' => 1,
2238
                            'max' => 255
2239
                        )
2240
                    )
2241
                )
2242
            )));
2243
            
2244
            $inputFilter->add($factory->createInput(array(
2245
                'name' => 'anonymousIdentifier',
2246
                'required' => false,
2247
                'filters' => array(
2248
                    array(
2249
                        'name' => 'StripTags'
2250
                    ),
2251
                    array(
2252
                        'name' => 'StringTrim'
2253
                    )
2254
                ),
2255
                'validators' => array(
2256
                    array(
2257
                        'name' => 'StringLength',
2258
                        'options' => array(
2259
                            'encoding' => 'UTF-8',
2260
                            'min' => 0,
2261
                            'max' => 255
2262
                        )
2263
                    )
2264
                )
2265
            )));
2266
2267
            $this->inputFilter = $inputFilter;
2268
        }
2269
2270
        return $this->inputFilter;
2271
    }
2272
2273
    public function setTranslatableLocale($locale)
2274
    {
2275
        $this->locale = $locale;
2276
    }
2277
}
2278