When there are classes with the same short name, and we try to load them with Factories by passing the full classname, only the first class is loaded.
There is no way to load the second class when specifying the full classname.
<?phpnamespaceApp\Models;
useCodeIgniter\Model;
class Sample extends Model
{
protected$table = 'samples';
protected$allowedFields = [];
}<?phpnamespaceApp\Models\Dir;
useCodeIgniter\Model;
class Sample extends Model
{
protected$table = 'dir_samples';
protected$allowedFields = [];
}<?phpnamespaceApp\Controllers;
useApp\Models\Dir\SampleasDirSample;
useApp\Models\Sample;
class Home extends BaseController
{
publicfunctionindex()
{
$sample = model(Sample::class);
$dirSample = model(DirSample::class);
var_dump($sample === $dirSample);
}
}The result is true.
Related #7684
When there are classes with the same short name, and we try to load them with Factories by passing the full classname, only the first class is loaded.
There is no way to load the second class when specifying the full classname.
The result is
true.Related #7684