@@ -1014,6 +1014,34 @@ public function getCSV($array)
10141014 return ob_get_clean (); // ... then return it as a string!
10151015 }
10161016
1017+
1018+ public function getUserActions ()
1019+ {
1020+ $ config = $ this ->serviceManager ->get ('config ' );
1021+ $ logFrontendUser = ($ config ['playgrounduser ' ]['log_frontend_user ' ]) ? $ config ['playgrounduser ' ]['log_frontend_user ' ] : false ;
1022+ $ routes = [];
1023+
1024+ // echo '$controllerClass : ' . $controllerClass . '<br/>';
1025+ // echo '$moduleName : ' .$moduleName. '<br/>';
1026+ // echo '$routeName : '.$routeName. '<br/>';
1027+ // echo '$areaName : '.$areaName. '<br/>';
1028+ // echo '$controllerName : ' .$controllerName. '<br/>';
1029+ // echo '$actionName : ' . $actionName. '<br/>';
1030+ if ($ logFrontendUser ) {
1031+ $ em = $ this ->getServiceManager ()->get ('doctrine.entitymanager.orm_default ' );
1032+ $ emConfig = $ em ->getConfiguration ();
1033+ $ emConfig ->addCustomStringFunction ('SUBSTRING_INDEX ' , '\DoctrineExtensions\Query\Mysql\SubstringIndex ' );
1034+ $ query = $ em ->createQuery (
1035+ "select DISTINCT CONCAT(SUBSTRING_INDEX(ul.controllerClass, ' \\', -1), '/', ul.actionName) as path from PlaygroundUser\Entity\UserLog ul
1036+ WHERE SUBSTRING_INDEX(ul.uri, '.', -1) NOT IN ('jpg','svg','gif','png','css','js')
1037+ AND ul.areaName = 'frontend' "
1038+ );
1039+ $ routes = $ query ->getResult ();
1040+ }
1041+
1042+ return $ routes ;
1043+ }
1044+
10171045 public function findAll ()
10181046 {
10191047 return $ this ->getUserMapper ()->findAll ();
0 commit comments