strTableName = $strTableName; try { R::setup( 'mysql:host=' . $objConfig->getHost() . ';dbname=' . $objConfig->getName(), $objConfig->getUser(), $objConfig->getPassword() ); } catch (Exception $ex) { alert($ex, 1); die(); } } ///// PUBLIC METHODS ////////////////////////////////////////////////////////////////////////////// /** * Counts the number of rows in the given table. * The RedBeans function have strict limitations * therefore an array function was used and the received array was converted into an integer. * * @return integer Returns the number of rows in the table */ public function getRowCount() { try { $arrResult = R::getAssoc('SELECT COUNT(*) FROM ' . $this->strTableName); $intReturnValue = array_values($arrResult)[0]; return $intReturnValue; } catch (Exception $ex) { alert($ex, 1); die(); } } }