\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Richard Holloway (richardjh)} \pdfinfo{ /Title (redbeanphp-class-reference.pdf) /Creator (Cheatography) /Author (Richard Holloway (richardjh)) /Subject (RedBeanPHP Class Reference Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{3D578C} \definecolor{LightBackground}{HTML}{F2F4F7} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{RedBeanPHP Class Reference Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Richard Holloway (richardjh)} via \textcolor{DarkBackground}{\uline{cheatography.com/478/cs/347/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Richard Holloway (richardjh) \\ \uline{cheatography.com/richardjh} \\ \uline{\seqsplit{richardjh}.org} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 16th April, 2012.\\ Updated 13th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{About RedBeanPHP ORM}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Easy ORM for PHP and MySQL, PostgreSQL and many other database systems. \newline % Row Count 2 (+ 2) Use the simplicity of NoSQL with the power of SQL. \newline % Row Count 4 (+ 2) http://redbeanphp.com/% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt1}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{addDatabase ( \$key, \$dsn, \$user=null, \$pass=null, \$frozen=false )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Adds a database to the facade, afterwards you can select the database using selectDatabase(\$key).} \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{addTags ( \$bean, \$tagList )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Part of RedBeanPHP Tagging API. Adds tags to a bean. If \$tagList is a comma separated list of tags all tags will be associated with the bean. You may also pass an array instead of a string.} \tn % Row Count 11 (+ 6) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{areRelated( \$bean1, \$bean2 )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Checks whether a pair of beans is related N-M. This function does not check whether the beans are related in N:1 way.} \tn % Row Count 15 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{associate( \$bean1, \$bean2, \$extra=null )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Associates two Beans. This method will associate two beans with eachother. You can then get one of the beans by using the related() function and providing the other bean.} \tn % Row Count 20 (+ 5) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{batch( \$type, \$ids )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns an array of beans. Pass a type and a series of ids and this method will bring you the correspondig beans.} \tn % Row Count 24 (+ 4) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{begin()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Facade Convience method for adapter transaction system. Begins a transaction.} \tn % Row Count 27 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{clearRelations( \$bean, \$type )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Clears all associated beans. Breaks all many-to-many associations of a bean and a specified type.} \tn % Row Count 31 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt1 (cont)}} \tn % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{close()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Closes the database connection.} \tn % Row Count 2 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{commit()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Facade Convience method for adapter transaction system. Commits a transaction.} \tn % Row Count 5 (+ 3) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{configureFacadeWithToolbox(} \$tb )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Configures the facade, want to have a new Writer? A new Object Database or a new Adapter and you want it on-the-fly? Use this method to hot-swap your facade with a new toolbox.} \tn % Row Count 10 (+ 5) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{convertToBeans( \$type, \$rows )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Converts a series of rows to beans.} \tn % Row Count 12 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{count( \$beanType )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Counts beans} \tn % Row Count 14 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{debug( \$tr=true )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Toggles DEBUG mode. In Debug mode all SQL that happens under the hood will be printed to the screen.} \tn % Row Count 18 (+ 4) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{dependencies( \$dep )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Sets a list of dependencies. A dependency list contains an entry for each dependent bean. A dependent bean will be removed if the relation with one of the dependencies gets broken.} \tn % Row Count 23 (+ 5) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{dispense( \$type, \$num )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Dispenses a new RedBean OODB Bean for use with the rest of the methods.} \tn % Row Count 26 (+ 3) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{dispenseLabels( \$type, \$labels )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}A label is a bean with only an id, type and name property. This function will dispense beans for all entries in the array. The values of the array will be assigned to the name property of each individual bean.} \tn % Row Count 32 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt1 (cont)}} \tn % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{dup( \$bean, \$trail, \$pid=false )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Makes a copy of a bean. This method makes a deep copy of the bean.} \tn % Row Count 3 (+ 3) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{exec( \$sql, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Convenience function to execute Queries directly. Executes SQL.} \tn % Row Count 6 (+ 3) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{exportAll( \$beans )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Exports a collection of beans. Handy for XML/JSON exports with a Javascript framework like Dojo or ExtJS.} \tn % Row Count 10 (+ 4) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{find( \$type, \$sql=null, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Finds a bean using a type and a where clause (SQL). As with most Query tools in RedBean you can provide values to be inserted in the SQL statement by populating the value array parameter; you can either use the question mark notation or the slot-notation (:keyname).} \tn % Row Count 17 (+ 7) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{findAll( \$type, \$sql=null, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Finds a bean using a type and a where clause (SQL). As with most Query tools in RedBean you can provide values to be inserted in the SQL statement by populating the value array parameter; you can either use the question mark notation or the slot-notation (:keyname). The findAll() method differs from the find() method in that it does not assume a WHERE-clause.} \tn % Row Count 26 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt2}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{findAndExport( \$type, \$sql=null, \$value=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Finds a bean using a type and a where clause (SQL). As with most Query tools in RedBean you can provide values to be inserted in the SQL statement by populating the value array parameter; you can either use the question mark notation or the slot-notation (:keyname). The variation also exports the beans (i.e. it returns arrays).} \tn % Row Count 8 (+ 8) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{findLast( \$type, \$sql=null, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Finds a bean using a type and a where clause (SQL). As with most Query tools in RedBean you can provide values to be inserted in the SQL statement by populating the value array parameter; you can either use the question mark notation or the slot-notation (:keyname). This variation returns the last bean only.} \tn % Row Count 16 (+ 8) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{findOne( \$type, \$sql=null, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Finds a bean using a type and a where clause (SQL). As with most Query tools in RedBean you can provide values to be inserted in the SQL statement by populating the value array parameter; you can either use the question mark notation or the slot-notation (:keyname). This variation returns the first bean only.} \tn % Row Count 24 (+ 8) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{findOrDispense( \$type, \$sql, \$values )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Convenience method. Tries to find beans of a certain type, if no beans are found, it dispenses a bean of that type.} \tn % Row Count 28 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{freeze( \$tr=true )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Toggles fluid or frozen mode. In fluid mode the database structure is adjusted to accomodate your objects. In frozen mode this is not the case.} \tn % Row Count 33 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt2 (cont)}} \tn % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{gatherLabels( \$beans )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Gathers labels from beans. This function loops through the beans, collects the values of the name properties of each individual bean and stores the names in a new array. The array then gets sorted using the default sort function of PHP (sort).} \tn % Row Count 7 (+ 7) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{genSlots( \$array )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Generates question mark slots for an array of values.} \tn % Row Count 10 (+ 3) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{getAll( \$sql, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Convenience function to execute Queries directly. Executes SQL.} \tn % Row Count 13 (+ 3) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{getAssoc( \$sql, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Convenience function to execute Queries directly. Executes SQL. Results will be returned as an associative array. The first column in the select clause will be used for the keys in this array and the second column will be used for the values. If only one column is selected in the query, both key and value of the array will have the value of this field for each row.} \tn % Row Count 22 (+ 9) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{getCell( \$sql, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Convenience function to execute Queries directly. Executes SQL.} \tn % Row Count 25 (+ 3) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{getCol( \$sql, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Convenience function to execute Queries directly. Executes SQL.} \tn % Row Count 28 (+ 3) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{getColumns( \$table )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns a list of columns. Format of this array: array( fieldname =\textgreater{} type ) Note that this method only works in fluid mode because it might be quite heavy on production servers!} \tn % Row Count 33 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt2 (cont)}} \tn % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{getRow( \$sql, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Convenience function to execute Queries directly. Executes SQL.} \tn % Row Count 3 (+ 3) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{getVersion()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Get version} \tn % Row Count 5 (+ 2) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{graph( \$array, \$filterEmpty=false )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}facade method for Cooker Graph.} \tn % Row Count 7 (+ 2) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{hasTags( \$bean, \$tags, \$all=false )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Part of RedBeanPHP Tagging API. Tests whether a bean has been associated with one ore more of the listed tags. If the third parameter is TRUE this method will return TRUE only if all tags that have been specified are indeed associated with the given bean, otherwise FALSE. If the third parameter is FALSE this method will return TRUE if one of the tags matches, FALSE if none match.} \tn % Row Count 17 (+ 10) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt3}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{isoDate( \$time=null )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Simple convenience function, returns ISO date formatted representation of \$time} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{isoDateTime( \$time=null )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Simple convenience function, returns ISO date time formatted representation of \$time.} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{load( \$type, \$id )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Loads the bean with the given type and id and returns it.} \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{log( \$filename )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Activates TimeLine Schema Alteration monitoring and Query logging.} \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{nuke()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Nukes the entire database} \tn % Row Count 14 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{query( \$method, \$sql, \$values )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Internal Query function, executes the desired query. Used by all facade query functions. This keeps things DRY.} \tn % Row Count 18 (+ 4) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{related( \$bean, \$type, \$sql=null, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns all the beans associated with \$bean. This method will return an array containing all the beans that have been associated once with the associate() function and are still associated with the bean specified.} \tn % Row Count 25 (+ 7) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{relatedOne( \$bean, \$type, \$sql=null, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Returns only single associated bean.} \tn % Row Count 28 (+ 3) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{rollback()} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Facade Convience method for adapter transaction system. Rolls back a transaction.} \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt3 (cont)}} \tn % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{selectDatabase( \$key )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Selects a different database for the Facade to work with.} \tn % Row Count 3 (+ 3) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{setup( \$dsn=null, \$username=null, \$password=null )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Kickstarts redbean for you. This method should be called before you start using RedBean. The Setup() method can be called without any arguments, in this case it will try to create a SQLite database in /tmp called red.db (this only works on UNIX-like systems).} \tn % Row Count 10 (+ 7) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{store( \$bean )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Stores a RedBean OODB Bean and returns the ID.} \tn % Row Count 12 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{storeAll( \$beans )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Short hand function to store a set of beans at once, IDs will be returned as an array. For information please consult the R::store() function. A loop saver.} \tn % Row Count 17 (+ 5) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{swap( \$beans, \$property )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Given an array of two beans and a property, this method swaps the value of the property. This is handy if you need to swap the priority or orderNo of an item (i.e. bug-tracking, page order).} \tn % Row Count 23 (+ 6) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{tag( \$bean, \$tagList=null )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Part of RedBeanPHP Tagging API. Tags a bean or returns tags associated with a bean. If \$tagList is null or omitted this method will return a comma separated list of tags associated with the bean provided. If \$tagList is a comma separated list (string) of tags all tags will be associated with the bean. You may also pass an array instead of a string.} \tn % Row Count 32 (+ 9) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference pt3 (cont)}} \tn % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{tagged( \$beanType, \$tagList )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Part of RedBeanPHP Tagging API. Returns all beans that have been tagged with one of the tags given.} \tn % Row Count 4 (+ 4) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{trash( \$bean )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Deletes the specified bean.} \tn % Row Count 6 (+ 2) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{trashAll( \$beans )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Short hand function to trash a set of beans at once. For information please consult the R::trash() function. A loop saver.} \tn % Row Count 10 (+ 4) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{unassociate( \$bean1, \$bean2, fast=false )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Breaks the association between two beans. This functions breaks the association between a pair of beans. After calling this functions the beans will no longer be associated with eachother. Calling related() with either one of the beans will no longer return the other bean.} \tn % Row Count 17 (+ 7) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{unrelated( \$bean, \$type, \$sql=null, \$values=array() )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}The opposite of related(). Returns all the beans that are not associated with the bean provided.} \tn % Row Count 22 (+ 5) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{untag( \$bean, \$tagList )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Part of RedBeanPHP Tagging API. Removes all sepcified tags from the bean. The tags specified in the second parameter will no longer be associated with the bean.} \tn % Row Count 27 (+ 5) % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{wipe( \$beanType )} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Wipes all beans of type \$beanType.} \tn % Row Count 29 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Class Reference: See Also}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Converted from the comments in the source code. \newline % Row Count 1 (+ 1) See \seqsplit{http://www.redbeanphp.com/api/d9/daa/class\_red\_bean\_\_\_facade.html} for more details.% Row Count 3 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}