Author Topic: PHP Active Record  (Read 2739 times)

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
PHP Active Record
« on: April 25, 2011, 11:25:43 AM »
I'm going to implement some form of Active Record in an application I'm developing.  I found this: http://www.phpactiverecord.org/

I've looked it over and it looks like they are actively working on it but I wanted to know if there is a better PHP alternative out there?

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: PHP Active Record
« Reply #1 on: April 25, 2011, 11:27:47 AM »
this is the only one I've seen previously. I think its a good idea, especially if you're rolling your own frame work (or not using one at all)
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: PHP Active Record
« Reply #2 on: April 25, 2011, 11:34:14 AM »
http://www.propelorm.org/

Interesting but may be overkill for what I want to do.

I'm using a framework I created a few years ago so it's my own brew.  So I don't want a full framework (Zend, etc.), just the database interaction stuff.  I have my own objects for different items in the application, but I need to manage the database stuff better.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: PHP Active Record
« Reply #3 on: April 25, 2011, 03:32:15 PM »
I'm playing around with PHPActiveRecord.  Is there a way to set it up so that it emails me if a query fails instead of just logging it?  Maybe that's just a bad way to design, but in my existing error handling class for SQL, it emails me if an error occurs.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: PHP Active Record
« Reply #4 on: November 05, 2012, 10:27:44 PM »
By the way, I'm all in with PHPActiveRecord.  It has taken me a little time to get used to it and I still have to go to the documentation some for some somewhat basic queries, but the simplicity and power is just awesome!

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: PHP Active Record
« Reply #5 on: November 06, 2012, 09:19:08 AM »
 :thumbsup:   I still haven't used it yet, but good to hear that you like it.  I'm still meaning to try it someday when I have a reason to.   At work, just about everything I do is inside the Kohana framework which has its own system that is fairly powerfull (if not sometimes a little frustraighting and poorly documented)

for small projects that don't need a lot of relational mapping, there's a really sweet lightweight class I found called idiorm that I love and use regularly whenever I'm working out side of our heavier framework and just need to do simple database operations (although, it allows you to insert raw SQL as well)
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: PHP Active Record
« Reply #6 on: November 06, 2012, 09:22:06 AM »
Yeah, phpactiverecord documentation could have a few more examples, but overall it's pretty good.  It also allows you to do direct queries as well if you need to but I think I've only had to do that a few times.