PotentialActionsTrait::addPotentialAction()   A
last analyzed

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 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) 2019, Wesley O. Nichols
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Wesnick\WorkflowBundle\Model;
13
14
use ApiPlatform\Core\Annotation\ApiProperty;
15
use Symfony\Component\Serializer\Annotation\Groups;
16
17
/**
18
 * Trait PotentialActionsTrait.
19
 *
20
 * @author Wesley O. Nichols <[email protected]>
21
 */
22
trait PotentialActionsTrait
23
{
24
    /**
25
     * @var Action[] collection of potential Action, which describes an idealized action in which this thing
26
     *               would play an 'object' role
27
     *
28
     * @ApiProperty(
29
     *     iri="http://schema.org/potentialAction",
30
     *     readable=true,
31
     *     writable=false
32
     * )
33
     * @Groups({"workflowAction:output"})
34
     */
35
    private $potentialAction = [];
36
37
    /**
38
     * @param Action $action
39
     */
40
    public function addPotentialAction(Action $action)
41
    {
42
        $this->potentialAction[] = $action;
43
    }
44
45
    /**
46
     * @return array
47
     */
48
    public function getPotentialAction(): array
49
    {
50
        return $this->potentialAction;
51
    }
52
}
53