Navigation:  "The Jet Engine" PHP Application Framework > Programming Concepts > Jet Engine Objects > iSQL Record Objects >

Extending

Previous pageReturn to chapter overviewNext page

Extending the Record Object

 

Since the Record is a PHP Object, you can create a subclass of the Record Object yourself, to both override built-in methods (like "delete()") to add additional logic, or add your own methods specific to your needs. In general, the built-in functions should suffice, but when you have a need to subclass, you ceartainly can.

 

 

   class Account extends Record {

     

       function delete() {

 

          // Get our record ID

          $id = $this->data['id'];

 

          // Delete any records from other tables that associate

          // with is record

          $SQL = "DELETE FROM someothertable WHERE id = $id";

          $this->iSQL>run($SQL);

 

          // Delete ourselves

          parent::delete();

       }

 

   }

 


This help file was created with an unregistered evaluation copy of Help & Manual. © EC Software. All rights reserved. This message will not appear if you compile this help file with the registered version of Help & Manual.