parse error, expecting `T_PAAMAYIM_NEKUDOTAYIM' error in activecollab model class

activecollab, controller, module, permissions, php

Solution

    foreach($roles as $role) {
        if($role->getPermissionValue($name))
            return true;
        else
            return false;

You're missing a closing } there. So it should be:

  class Projectrequests extends DataManager {

   ...
   ....

        function getPermissionValue($name){
            $roles = Roles::find();
            foreach($roles as $role) {
                if($role->getPermissionValue($name))
                    return true;
                else
                    return false;
            } // <-- here
        }

        static function canAccess() {
          if(self::getPermissionValue('can_use_project_request')) return true;
            return false;
        } // canAccess

  ...
  ..

  }

Problem

I'm working on activecollab custom module's permissions, and getting this error message when try to calling function of static method dont know why; please do help will be really appericiatable .. ``` Parse error: parse error, expecting `T_PAAMAYIM_NEKUDOTAYIM' in D:\wamp\www\activecollab\public\activecollab\3.0.9\modules\projectcomrequest\models\Projectcomrequests.class.php on line 130 ``` the code I did in model file is: ``` class Projectrequests extends DataManager { ... .... function getPermissionValue($name){ $roles = Roles::find(); foreach($roles as $role) { if($role->getPermissionValue($name)) return true; else return false; } static function canAccess() { if(self::getPermissionValue('can_use_project_request')) return true; return false; } // canAccess ... .. } ``` calling in controller by this: ``` echo Projectrequests::canAccess(); ```

Original source