Well, I came up with an idea a couple of days ago. Though I'm not sure how well it'll do in the long run, but for now, I like the idea, as it'll help me clean up my projects code a bit once I implement it.
But I want a 2nd opinion from any Expert who is willing to look it over real quick.
Summary:
Heres my basic usage assuming theres DB Entries:
Mostly I like it cause I won't have to deal with indexes, and all the dang brackets. lol...
So I would like an opinion if anyone wishes to share please. Thanks.
But I want a 2nd opinion from any Expert who is willing to look it over real quick.
Summary:
- Data class;
- Caches database entries of a given table (more then one class type) via json_encode();
- Each "Column" of database has class property;
- method set_id() sets each property, mentioned above, to the supplied database entry id;
- has cycle feature, auto cycles through each database entry, effectively making it a loop;
Heres my basic usage assuming theres DB Entries:
Code:
// Two different database tables, with similar Columns / Properties
$equipment = new Type('equipment');
$repair = new Type('repair');
// Single Entry usage
$equipment->set_id(4);
echo 'ID: ', $equipment->id, '; Name: ', $equipment->name, ';';
// Cycle through all entries
$repair->cycle_start();
for ($i=0;$i<$repair->count;$i++) {
echo 'ID: ', $repair->id, '; Name: ', $repair->name, ';<br>';
$repair->cycle_next();
}
$repair->cycle_end();
So I would like an opinion if anyone wishes to share please. Thanks.
Comment