original_string: protected function countTotalListViewData($keyword = null) {
          $count = 0;
  
          if ($this->listViewDataClosure != null) {
  
              if ($this->countListViewDataClosure != null) {
                  $c = $this->countListViewDataClosure;
                  return  $c($keyword);
              } else {
                  return 100000;
              }
  
          } elseif ($this->searchResultCountClosure != null) {            // For Custom Searching
              $c = $this->searchResultCountClosure;
              return $c($keyword);
              
          } else {
              $this->beforeGetListViewData(function ($tableName, $findClause, $limit, $bindingData) use (&$count) {
  
                  // For RedBean Case
                  $count = R::getCell("SELECT COUNT(*) FROM `$tableName` WHERE $findClause $limit", $bindingData);
  
              }, function ($sql, $limit, $bindingData) use (&$count) {
  
                  // For SQL Case
                  $count = R::getRow("SELECT COUNT(*) AS `count` FROM (" . $sql . $limit . ") AS user_defined_query", $bindingData)["count"];
  
              }, null, null, $keyword);
  
          }
  
  
  
          return $count;
      }
code: protected function countTotalListViewData($keyword = null) {
          $count = 0;
  
          if ($this->listViewDataClosure != null) {
  
              if ($this->countListViewDataClosure != null) {
                  $c = $this->countListViewDataClosure;
                  return  $c($keyword);
              } else {
                  return 100000;
              }
  
          } elseif ($this->searchResultCountClosure != null) {            // For Custom Searching
              $c = $this->searchResultCountClosure;
              return $c($keyword);
              
          } else {
              $this->beforeGetListViewData(function ($tableName, $findClause, $limit, $bindingData) use (&$count) {
  
                  // For RedBean Case
                  $count = R::getCell("SELECT COUNT(*) FROM `$tableName` WHERE $findClause $limit", $bindingData);
  
              }, function ($sql, $limit, $bindingData) use (&$count) {
  
                  // For SQL Case
                  $count = R::getRow("SELECT COUNT(*) AS `count` FROM (" . $sql . $limit . ") AS user_defined_query", $bindingData)["count"];
  
              }, null, null, $keyword);
  
          }
  
  
  
          return $count;
      }
code_tokens: protected function countTotalListViewData ( $ keyword = null ) { $ count = 0 ; if ( $ this -> listViewDataClosure != null ) { if ( $ this -> countListViewDataClosure != null ) { $ c = $ this -> countListViewDataClosure ; return $ c ( $ keyword ) ; } else { return 100000 ; } } elseif ( $ this -> searchResultCountClosure != null ) { // For Custom Searching $ c = $ this -> searchResultCountClosure ; return $ c ( $ keyword ) ; } else { $ this -> beforeGetListViewData ( function ( $ tableName , $ findClause , $ limit , $ bindingData ) use ( & $ count ) { // For RedBean Case $ count = R :: getCell ( "SELECT COUNT(*) FROM `$tableName` WHERE $findClause $limit" , $ bindingData ) ; } , function ( $ sql , $ limit , $ bindingData ) use ( & $ count ) { // For SQL Case $ count = R :: getRow ( "SELECT COUNT(*) AS `count` FROM (" . $ sql . $ limit . ") AS user_defined_query" , $ bindingData ) [ "count" ] ; } , null , null , $ keyword ) ; } return $ count ; }
docstring: Count Total List view data
  @param string $keyword
  @return int
docstring_tokens: Count Total List view data