Skip to content

Commit 867434c

Browse files
committed
Connected to parent constructor to preserve creation logic nad passed old style db() as database dependency
1 parent 4a3d31f commit 867434c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/dbQuery.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,14 @@ public function className($className = null)
360360
*/
361361
public function __construct($entity = null)
362362
{
363-
$this->className($entity);
364-
$this->flush();
363+
// Old support for not full class names
364+
if (strpos($entity, '\\') === false) {
365+
// Add generic namespace
366+
$entity = '\samson\activerecord\\'.$entity;
367+
}
368+
369+
// Call parent constructor
370+
parent::__construct($entity, db());
365371
}
366372

367373
// Magic method after-clonning

0 commit comments

Comments
 (0)