original_string: protected function getPersistentRoleScopeBy($role, Scope $scope = null) 
      {
          $em = $this->getDoctrine()->getManager();
          
          $roleScope = $em->getRepository('ChillMainBundle:RoleScope')
                  ->findOneBy(array('role' => $role, 'scope' => $scope));
          
          if ($roleScope === NULL) {
              $roleScope = (new RoleScope())
                      ->setRole($role)
                      ->setScope($scope)
                      ;
              
              $em->persist($roleScope);
          }
          
          return $roleScope;
      }
code: protected function getPersistentRoleScopeBy($role, Scope $scope = null) 
      {
          $em = $this->getDoctrine()->getManager();
          
          $roleScope = $em->getRepository('ChillMainBundle:RoleScope')
                  ->findOneBy(array('role' => $role, 'scope' => $scope));
          
          if ($roleScope === NULL) {
              $roleScope = (new RoleScope())
                      ->setRole($role)
                      ->setScope($scope)
                      ;
              
              $em->persist($roleScope);
          }
          
          return $roleScope;
      }
code_tokens: protected function getPersistentRoleScopeBy ( $ role , Scope $ scope = null ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ roleScope = $ em -> getRepository ( 'ChillMainBundle:RoleScope' ) -> findOneBy ( array ( 'role' => $ role , 'scope' => $ scope ) ) ; if ( $ roleScope === NULL ) { $ roleScope = ( new RoleScope ( ) ) -> setRole ( $ role ) -> setScope ( $ scope ) ; $ em -> persist ( $ roleScope ) ; } return $ roleScope ; }
docstring: get a role scope by his parameters. The role scope is persisted if it
  doesn't exists in database.
  
  @param Scope $scope
  @param string $role
  @return RoleScope
docstring_tokens: get a role scope by his parameters . The role scope is persisted if it doesn t exists in database .