@@ -38,41 +38,41 @@ public function findById($id) {
3838
3939 /** Delete Data by Id */
4040 public function delete (array $ args ) {
41- $ data = $ this ->repository ->findBy ($ args )[0 ] ?? null ;
41+ $ row = $ this ->repository ->findBy ($ args )[0 ] ?? null ;
4242
43- if ($ data ):
44- $ this ->entityManager ->remove ($ data );
43+ if ($ row ):
44+ $ this ->entityManager ->remove ($ row );
4545 $ this ->entityManager ->flush ();
4646
47- return $ data ;
47+ return $ row ;
4848 endif ;
4949 }
5050
5151 /** Update Data by Id */
5252 public function update (array $ data , array $ args ) {
53- $ item = $ this ->repository ->findBy ($ args )[0 ] ?? null ;
53+ $ row = $ this ->repository ->findBy ($ args )[0 ] ?? null ;
5454
55- if ($ item ):
55+ if ($ row ):
5656 foreach ($ data as $ key => $ value )
57- $ item ->__set ($ key , $ value );
57+ $ row ->__set ($ key , $ value );
5858
59- $ this ->entityManager ->merge ($ item );
59+ $ this ->entityManager ->merge ($ row );
6060 $ this ->entityManager ->flush ();
6161
62- return $ data ;
62+ return $ row ;
6363 endif ;
6464 }
6565
6666 /** Insert Data */
67- public function insert (array $ args ) {
68- $ data = new $ this ->entity ;
67+ public function insert (array $ data ) {
68+ $ row = new $ this ->entity ;
6969
70- foreach ($ args as $ key => $ value )
71- $ data ->__set ($ key , $ value );
70+ foreach ($ data as $ key => $ value )
71+ $ row ->__set ($ key , $ value );
7272
73- $ this ->entityManager ->persist ($ data );
73+ $ this ->entityManager ->persist ($ row );
7474 $ this ->entityManager ->flush ();
7575
76- return $ data ;
76+ return $ row ;
7777 }
7878}
0 commit comments