• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Red beanphp orm presentation
 

Red beanphp orm presentation

on

  • 1,346 views

An overview of the RedBean ORM for PHP

An overview of the RedBean ORM for PHP

Statistics

Views

Total Views
1,346
Views on SlideShare
1,342
Embed Views
4

Actions

Likes
1
Downloads
6
Comments
1

2 Embeds 4

http://twitter.com 2
http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • I was there. Chris did a good presentation. Thanks Chris!
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Red beanphp orm presentation Red beanphp orm presentation Presentation Transcript

      • redbeanphp.com
    • RedBean ORM
      • ORM – Object Relational Model
      • “The Easiest ORM”
      • Simple to
        • Install
        • Use
        • Grow
        • Live with
    • Are you living in the real world?
      • Do you know your complete data model before you start a project? Does it ever change?
      • Ever heard this?
        • “Just get it done!”
        • “We'll fix it tomorrow”
      • 1 include file
      • 1 connect line
      • Start coding
      • include_once('rb.php'); $book = $redbean->dispense("book"); //Make a new book $book->author = "Santa Claus"; //Give it some properties $book->title = "Secrets of Christmas"; $id = $redbean->store( $book ); //Persist it $book = $redbean->load( "book", $id ); //Find a book $books = Finder::where("book", "author = :str", array(":str"=>'Santa Claus')); $redbean->trash( $book ); //Throw it away
    • Got Code?
      • CodeMonkey like RedBean...
    • What Else?
      • When you don't want to be flexible any more and want more speed, ->freeze().
        • Prevents DB changes and field growing.
      • Hierarchies
        • R::attach($father,$daughter); R::attach($father,$son); $children = R::children( $father ); $father = R::getParent( $son ); $parent_id = $child->parent_id;
    • Write your own models
      • Auto-discovers the right classes
        • Validation
        • Data Normalization
      • class Model_Book extends RedBean_SimpleModel { public function update() { if (!preg_match( $somePattern, $this->title )) { throw new Exception("Illegal title!"); } } }
    • Advanced Stuff
      • Plugins
        • Table Optimizer (auto date!)
        • Caching
      • Unit of Work – For Transactions
      • Framework Integration
        • Kohana
        • Zend
        • Code Igniter
    • Good/Bad/Fugly
      • Good
        • Small (227k. Doctrine is about 2 meg in 382 files)
        • Easy to understand (5 methods on one class)
        • No new languages (uses SQL for queries)
      • Bad
        • No chaining ($authors = $book->authors->order_by('author_name);)
      • Fugly
        • Uses PDO. (Fake with R::$db = $mydbobject; )