-
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
Nette Di 3.1.2
Bug Description
... The multifactory create does not work showing that must have just one non-static method get()
Steps To Reproduce
applying the example of the multifactory documentation, this returns me that I have to have a get method, reference nette forum
User Model
declare(strict_types=1);
namespace App\Modules\Admin\User\Model;
use Nette;
final class User {
protected $user;
public function __construct(private Nette\Database\Explorer $db,) {
$this->user = 'user';
}
public function all() {
return $this->db->table($this->user)->where('active = ? AND deleted = ?',1,0);
}
}
UsersModelFactory
declare(strict_types=1);
namespace App\Modules\Admin\User\Model;
use App\Modules\Admin\User\Model\User;
use App\Modules\Admin\User\Model\Prube;
interface UserModelsFactory {
function createUser(): User;
function createPrube(): Prube; // another model like user
}
neon file
services:
- App\Modules\Admin\User\Model\UserModelsFactory
the result is tracy showing error 500 with the message
Service '02': Interface App\Modules\Admin\User\Model\UserModelsFactory must have just one non-static method get()
Expected Behavior
The same result with unitary factories interface where the create function is called
Possible Solution
... sorry not.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels