original_string: public function loadRules(string $entity_id)
      {
          $records = ACLRule::get(["entity_id" => $entity_id]);
          $rules = array();
          foreach ($records as $record)
          {
              $rule = new Rule($record->entity_id, $record->role_id, $record->action, $record->policy);
              $rule->setRecord($record);
              $rules[] = $rule;
          }
  
          return $rules;
      }
code: public function loadRules(string $entity_id)
      {
          $records = ACLRule::get(["entity_id" => $entity_id]);
          $rules = array();
          foreach ($records as $record)
          {
              $rule = new Rule($record->entity_id, $record->role_id, $record->action, $record->policy);
              $rule->setRecord($record);
              $rules[] = $rule;
          }
  
          return $rules;
      }
code_tokens: public function loadRules ( string $ entity_id ) { $ records = ACLRule :: get ( [ "entity_id" => $ entity_id ] ) ; $ rules = array ( ) ; foreach ( $ records as $ record ) { $ rule = new Rule ( $ record -> entity_id , $ record -> role_id , $ record -> action , $ record -> policy ) ; $ rule -> setRecord ( $ record ) ; $ rules [ ] = $ rule ; } return $ rules ; }
docstring: Loads the rules for the specified entity from the database.
docstring_tokens: Loads the rules for the specified entity from the database .