Code Duplication    Length = 11-11 lines in 4 locations

code/Model/EditableCustomRule.php 1 location

@@ 94-104 (lines=11) @@
91
     * @param array $context Virtual parameter to allow context to be passed in to check
92
     * @return bool
93
     */
94
    public function canCreate($member = null, $context = [])
95
    {
96
        // Check parent page
97
        $parent = $this->getCanCreateContext(func_get_args());
98
        if ($parent) {
99
            return $parent->canEdit($member);
100
        }
101
102
        // Fall back to secure admin permissions
103
        return parent::canCreate($member);
104
    }
105
106
    /**
107
     * Helper method to check the parent for this object

code/Model/Recipient/EmailRecipientCondition.php 1 location

@@ 112-122 (lines=11) @@
109
     * @param array $context Virtual parameter to allow context to be passed in to check
110
     * @return bool
111
     */
112
    public function canCreate($member = null, $context = [])
113
    {
114
        // Check parent page
115
        $parent = $this->getCanCreateContext(func_get_args());
116
        if ($parent) {
117
            return $parent->canEdit($member);
118
        }
119
120
        // Fall back to secure admin permissions
121
        return parent::canCreate($member);
122
    }
123
124
    /**
125
     * Helper method to check the parent for this object

code/Model/EditableFormField.php 1 location

@@ 521-531 (lines=11) @@
518
     * @param array $context Virtual parameter to allow context to be passed in to check
519
     * @return bool
520
     */
521
    public function canCreate($member = null, $context = [])
522
    {
523
        // Check parent page
524
        $parent = $this->getCanCreateContext(func_get_args());
525
        if ($parent) {
526
            return $parent->canEdit($member);
527
        }
528
529
        // Fall back to secure admin permissions
530
        return parent::canCreate($member);
531
    }
532
533
    /**
534
     * Helper method to check the parent for this object

code/Model/Recipient/EmailRecipient.php 1 location

@@ 396-406 (lines=11) @@
393
     * @param array $context Virtual parameter to allow context to be passed in to check
394
     * @return bool
395
     */
396
    public function canCreate($member = null, $context = [])
397
    {
398
        // Check parent page
399
        $parent = $this->getCanCreateContext(func_get_args());
400
        if ($parent) {
401
            return $parent->canEdit($member);
402
        }
403
404
        // Fall back to secure admin permissions
405
        return parent::canCreate($member);
406
    }
407
408
    /**
409
     * Helper method to check the parent for this object