Women in Technology

Hear us Roar



Article:
  Simplify Business Logic with PHP DataObjects
Subject:   DataObject super class
Date:   2004-08-06 11:55:20
From:   DarrylP
Something I didn't get a chance to include in the article was some code for a simple generic DataObject super class. Click here to see the source of a handy DataObject super class I use in my real world code.


Note, it does use the Reflection API and some PHP 5 specific keywordds, but it can easily be modified to work with PHP 4.

Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • DataObject super class
    2006-09-18 19:46:45  LeandroVieiraPinho [View]

    Hi DarryIP,

    I like so much your article, itīs pretty cool.

    But, I`m studing your DataObject super class, and Iīm found a dificult, maybe you can help me

    In this line: $this->dop_className = 'DO_' . $tableName;

    I create the name of a class, and in that:

    $class = new ReflectionClass($this->dop_className);

    Iīm using the ReflectionClass, but it isnīt function, the PHP is return the error:

    Fatal error: Uncaught exception 'ReflectionException' with message 'Class dop_teste does not exist' in ...

    Of course, the class doesnīt exist, but how you work with this? Can you help-me?

    Thanks.
  • DataObject super class
    2005-06-24 23:31:45  phylaxis [View]

    So what are the chances of you getting to show us the DataObject super class converted (for PHP 4) to not use the Reflection API and PHP 5 keywords? You say it can be done easily, but I am kind of a newbie to this stuff and don't know where to start. Thanks.
    • DataObject super class
      2006-09-18 20:01:10  LeandroVieiraPinho [View]

      Hi,

      I found this link in the Google, maybe it can help you: http://www.thinkit.co.jp/free/books/2/8/5/code.html

      Good Luck !