<?
abstract class BaseData
{
protected $connection;
public function __construct($connection)
{
$this->connection = $connection;
}
abstract public function connected();
abstract public function get();
}
class UserData extends BaseData
{
public function exists()
{
return is_connected($this->connection);
}
public function get()
{
return get_data($this->connection);
}
}
$UserData = new UserData(new Connection());
?>
In the above program i`m getting the follwing error: In line 26;
**Fatal error: Class UserData contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (BaseData::connected) in E:\xampp\htdocs\Antony\161214\Abstract\abstract6.php on line 26**
AntonyRayan 15 Posting Whiz in Training
SalmiSoft 102 Junior Poster
lorenzoDAlipio 24 Junior Poster in Training
Taywin 312 Posting Virtuoso
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.