1 | <?php |
||
29 | abstract class Entity extends \ORM\Entity |
||
30 | { |
||
31 | /** |
||
32 | * Return data as array |
||
33 | * |
||
34 | * @return array |
||
35 | * |
||
36 | * @codeCoverageIgnore |
||
37 | */ |
||
38 | public function getDataAsArray() |
||
42 | |||
43 | /** |
||
44 | * Save entity to database and add error handling for duplicate keys |
||
45 | * |
||
46 | * @param EntityManager $dbManager The custom entity manager |
||
47 | * @param bool $redirectOnDup If redirect should be initiated |
||
48 | * on duplicate key error |
||
49 | * |
||
50 | * @return Entity|\ORM\Entity|bool |
||
51 | * |
||
52 | * @throws NoEntity |
||
53 | * @throws NoConnection |
||
54 | * @throws NotScalar |
||
55 | * @throws UnsupportedDriver |
||
56 | * @throws IncompletePrimaryKey |
||
57 | * @throws InvalidConfiguration |
||
58 | * @throws InvalidName |
||
59 | * @throws NoEntityManager |
||
60 | * @throws IncompletePrimaryKey |
||
61 | * @throws InvalidArgumentException |
||
62 | */ |
||
63 | public function save(EntityManager $dbManager = null, $redirectOnDup = false) |
||
102 | |||
103 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: