Help with object-oriented PHP and sub-objects
I'm trying to achieve a simple behavior in my code, but i can't think of a decent way of doing it. Take a look at what i'm trying to do: 

    $db = new Database('mydb');
    $db->createTable('sample');
    
    $myTable = $db->getTable('test');
    $myTable->insert($data);
    $myTable->insert($data);
    $myTable->edit('2', $data2);
    $myTable->remove('1');

getTable is a method of the Database class, that returns an object of the Table class. The Table class has table-operation-specific methods, such as insert, edit and remove. 
Help with object-oriented PHP and sub-objects
===

I'm trying to achieve a simple behavior in my code, but i can't think of a decent way of doing it. Take a look at what i'm trying to do: 

    $db = new Database('mydb');
    $db->createTable('sample');
    
    $myTable = $db->getTable('test');
    $myTable->insert($data);
    $myTable->insert($data);
    $myTable->edit('2', $data2);
    $myTable->remove('1');

getTable is a method of the Database class, that returns an object of the Table class. The Table class has table-operation-specific methods, such as insert, edit and remove. 