protected function getRecord($tableName, $where = null)
    {
        $record = $this->database->table($tableName)->order('RAND()');
        return $where ?
            $record->where($where)->limit(1)->fetch() :
            $record->limit(1)->fetch();
    }
protected function getRecord($tableName, $where = null)
    {
        $record = $this->database->table($tableName)->order('RAND()');
        return $where ?
            $record->where($where)->limit(1)->fetch() :
            $record->limit(1)->fetch();
    }
protected function getRecord ( $ tableName , $ where = null ) { $ record = $ this -> database -> table ( $ tableName ) -> order ( 'RAND()' ) ; return $ where ? $ record -> where ( $ where ) -> limit ( 1 ) -> fetch ( ) : $ record -> limit ( 1 ) -> fetch ( ) ; }
Returns random record from given table.
@param string $tableName
@return IRow|false
Returns random record from given table .