par
sideb » 19 août 2006, 02:17
Je suis en train de faire une classe qui herite de mysqli, mais j'ai un probleme quand je fait appel aux methodes parents.
Je pense que je ne fais pas les appelles correctements, car apparement la class mysqli est consideree abstract.
Fatal error: Class MyMysqli contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (iMyMysqli::__contruct, iMyMysqli::Selectionner)
class MyMysqli extends mysqli implements iMyMysqli {
....
public function __construct($server="", $login="", $password="") {
$this->server = $server;
$this->login = $login;
$this->password = $password;
$this->connection = parent::__construct($this->server,$this->login,$this->password,$this->db);
....
Avec l'interface de ma class j'obtient un message different:
Fatal error: Class MyMysqli contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (iMyMysqli::__contruct, iMyMysqli::Selectionner)
EDIT: J'ai trouvais la solution: supprimer ces fonctions de l'interface, je verifie que ça marche.
Je suis en train de faire une classe qui herite de mysqli, mais j'ai un probleme quand je fait appel aux methodes parents.
Je pense que je ne fais pas les appelles correctements, car apparement la class mysqli est consideree abstract.
[quote]Fatal error: Class MyMysqli contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (iMyMysqli::__contruct, iMyMysqli::Selectionner)[/quote]
[php]
class MyMysqli extends mysqli implements iMyMysqli {
....
public function __construct($server="", $login="", $password="") {
$this->server = $server;
$this->login = $login;
$this->password = $password;
$this->connection = parent::__construct($this->server,$this->login,$this->password,$this->db);
....
[/php]
Avec l'interface de ma class j'obtient un message different:
[quote]Fatal error: Class MyMysqli contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (iMyMysqli::__contruct, iMyMysqli::Selectionner)[/quote]
[b]EDIT:[/b] J'ai trouvais la solution: supprimer ces fonctions de l'interface, je verifie que ça marche.