I have created my own DB - Model structure which is similar to Laravel. I have been facing with 2 problems.
I have a Model
class which all of my models extend it. For example, my User
class extends Model
. I want to return that get()
method return type of class which is extended.
Is this possible?
Class Model extends DB {
/**
* @return AnyClassThatExtended
*/
function get()
{
}
}
Class User extends Model {
function test() {
$user->get(); // I want it to return User type of object
}
}