original_string: public function check4Client($iCustomerId)
          {
  
              if ($this->get('security.context')->isGranted('ROLE_ADMIN')) {
                  return true;
              } else {
                  $oUser = $this->getUser();
                  if (empty($oUser)) {
                      return false;
                  }
  
                  $oResult = UserCustomerRelationQuery::create()->findOneByArray(array("UserId" => $oUser->getId(), "CustomerId" => $iCustomerId));
  
                  return (!empty($oResult));
              }
  
          }
code: public function check4Client($iCustomerId)
          {
  
              if ($this->get('security.context')->isGranted('ROLE_ADMIN')) {
                  return true;
              } else {
                  $oUser = $this->getUser();
                  if (empty($oUser)) {
                      return false;
                  }
  
                  $oResult = UserCustomerRelationQuery::create()->findOneByArray(array("UserId" => $oUser->getId(), "CustomerId" => $iCustomerId));
  
                  return (!empty($oResult));
              }
  
          }
code_tokens: public function check4Client ( $ iCustomerId ) { if ( $ this -> get ( 'security.context' ) -> isGranted ( 'ROLE_ADMIN' ) ) { return true ; } else { $ oUser = $ this -> getUser ( ) ; if ( empty ( $ oUser ) ) { return false ; } $ oResult = UserCustomerRelationQuery :: create ( ) -> findOneByArray ( array ( "UserId" => $ oUser -> getId ( ) , "CustomerId" => $ iCustomerId ) ) ; return ( ! empty ( $ oResult ) ) ; } }
docstring: Check if user has access to customer
  
  @param int $iCustomerId
  
  @return bool
docstring_tokens: Check if user has access to customer