1 | <?php |
||
25 | class RepositoryPersistence extends AbstractPersistence |
||
26 | { |
||
27 | /** |
||
28 | * @var \Romm\Formz\Persistence\Item\Repository\RepositoryPersistenceOption |
||
29 | */ |
||
30 | protected $options; |
||
31 | |||
32 | /** |
||
33 | * @var RepositoryInterface |
||
34 | */ |
||
35 | protected $repository; |
||
36 | |||
37 | /** |
||
38 | * @var PersistenceManager |
||
39 | */ |
||
40 | protected $persistenceManager; |
||
41 | |||
42 | /** |
||
43 | * Creates the repository instance. |
||
44 | */ |
||
45 | public function initialize() |
||
50 | |||
51 | /** |
||
52 | * Checks that the form instance that matches the identifier exists in the |
||
53 | * database. |
||
54 | * |
||
55 | * @param FormIdentifierObject $identifierObject |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function has(FormIdentifierObject $identifierObject) |
||
66 | |||
67 | /** |
||
68 | * Returns the form instance that matches the identifier. If it does not |
||
69 | * exist, and exception is thrown. |
||
70 | * |
||
71 | * @param FormIdentifierObject $identifierObject |
||
72 | * @return FormInterface |
||
73 | */ |
||
74 | public function fetch(FormIdentifierObject $identifierObject) |
||
83 | |||
84 | /** |
||
85 | * Saves the form instance in the database. |
||
86 | * |
||
87 | * If the given form instance is not an instance of `DomainObjectInterface`, |
||
88 | * an exception is thrown. |
||
89 | * |
||
90 | * @param FormIdentifierObject $identifierObject |
||
91 | * @param FormInterface $form |
||
92 | * @throws InvalidArgumentTypeException |
||
93 | */ |
||
94 | public function save(FormIdentifierObject $identifierObject, FormInterface $form) |
||
110 | |||
111 | /** |
||
112 | * Removes the given entry from database. |
||
113 | * |
||
114 | * @param FormIdentifierObject $identifierObject |
||
115 | */ |
||
116 | public function delete(FormIdentifierObject $identifierObject) |
||
124 | } |
||
125 |