0

Hi,

Is this structure correct guys because I get this error message "Fatal error: Class doL contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (AbstractData......."

Thanks in advance

abstract class AbstractDatabase{

...
Some function
...

	abstract public function setLogin();

	abstract protected function setLogout();

	abstract public function doLogin();

	abstract protected function doLogout();

}

class setL extends AbstractDatabase{

	public function setLogin(){
	}

	protected function setLogout(){
	}
}

class doL extends AbstractDatabase{

	public function doLogin(){
	}

	protected function doLogout(){
	}
}
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by sergb
0

Any non-abstract child class must implement all inherited abstract methods. You are getting the error because the doL class inherited 4 abstract methods from AbstractDatabase class, but implemented only 2 of them. Because of inheritance, to the compiler it looks like the doL class still has 2 abstract methods.

I am assuming the same error would be generated for the setL class.

Hope this helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.