33
33
namespace ElementaryFramework \LightQL \Sessions ;
34
34
35
35
use ElementaryFramework \Annotations \Annotations ;
36
+ use ElementaryFramework \LightQL \Annotations \NamedQueryAnnotation ;
36
37
use ElementaryFramework \LightQL \Entities \Entity ;
37
38
use ElementaryFramework \LightQL \Entities \EntityManager ;
38
39
use ElementaryFramework \LightQL \Entities \IEntity ;
@@ -104,7 +105,7 @@ public function __construct($class)
104
105
*
105
106
* @throws FacadeException
106
107
* @throws \ElementaryFramework\Annotations\Exceptions\AnnotationException
107
- * @throws \ElementaryFramework\LightQL\Exceptions\LightQLException
108
+ * @throws \ElementaryFramework\LightQL\Exceptions\EntityException
108
109
*/
109
110
public function create (Entity &$ entity )
110
111
{
@@ -122,7 +123,7 @@ public function create(Entity &$entity)
122
123
*
123
124
* @throws FacadeException
124
125
* @throws \ElementaryFramework\Annotations\Exceptions\AnnotationException
125
- * @throws \ElementaryFramework\LightQL\Exceptions\LightQLException
126
+ * @throws \ElementaryFramework\LightQL\Exceptions\EntityException
126
127
*/
127
128
public function edit (Entity &$ entity )
128
129
{
@@ -140,7 +141,7 @@ public function edit(Entity &$entity)
140
141
*
141
142
* @throws FacadeException
142
143
* @throws \ElementaryFramework\Annotations\Exceptions\AnnotationException
143
- * @throws \ElementaryFramework\LightQL\Exceptions\LightQLException
144
+ * @throws \ElementaryFramework\LightQL\Exceptions\EntityException
144
145
*/
145
146
public function delete (Entity &$ entity )
146
147
{
@@ -270,6 +271,7 @@ public function getNamedQuery(string $name): Query
270
271
$ namedQueries = Annotations::ofClass ($ this ->getEntityClassName (), "@namedQuery " );
271
272
$ query = null ;
272
273
274
+ /** @var NamedQueryAnnotation $namedQuery */
273
275
foreach ($ namedQueries as $ namedQuery ) {
274
276
if ($ namedQuery ->name === $ name ) {
275
277
$ query = $ namedQuery ->query ;
@@ -422,6 +424,7 @@ private function _parseRawEntites($rawEntities, $annotations): array
422
424
$ entities = array ();
423
425
424
426
foreach ($ rawEntities as $ rawEntity ) {
427
+ /** @var Entity $entity */
425
428
$ entity = $ this ->_class ->newInstance ($ rawEntity );
426
429
427
430
if ($ annotations [0 ]->fetchMode === Entity::FETCH_EAGER ) {
0 commit comments