Object model class

Hi can I ask how can I create Class that extends model and save record just like ORM, ELoquent etc…?

Class Lesson extends PDO_Lesson {
	protected $table = 'lesson';
}

I want to achieve to save record like this using PDO without framework , just simple if possible ?

$lesson= new Lesson();
$lesson->lesson_name = 'First lesson';
$lesson->save();

can you please share some link that I can start.

Thank you in advance.

So instead of just using a ORM you want to first write one and then use it? Why?

This is not as simple as it may look on the surface. It starts out simple, but there are so many weird edge cases to work around it gets real messy real fast.

2 Likes

Thank you for the reply. I thought this can be achieved easily :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.