I have an abstract class defined as follows:
abstract class Abstract Parent extends Zend_Db_Table_Abstract {
abstract function funcA($post);
abstract function funcB();
public function newEntry($post) {
$t1 = $this->funcA($post);
$t2 = $this->funcB();
}
}
The child class defines the two abstract methods, as follows:
require_once 'atablemodel.php';
class Child extends AbstractParent {
public function funcB()
{
return 'Some Value';
}
public function funcA($post)
{
$data = array(
'v1' => htmlentities($post['v1'])
);
return $data;
}
}
However, when I try this, I get an error:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/.../abstractparent.php on line 27
which is the line where the abstract parent is calling one of the abstract methods. What I want to have happen is that this line should call the child method, which is defined.
Now, I assume that there is a way to do this, and since I'm a beginner to PHP, I'm doing something fundamentally wrong. Any suggestions as to what I might do to resolve this? If I were to define the two abstract methods as having implementations, and then overriding those methods in all children (that is, not deal with abstract classes at all), how would I ensure that the parent calling one of those methods would call the appropriate child method at execution time?
EDIT
In light of the various comments about the issue of combining the static and abstract, I redefined the classes as above, with a new error, also shown above.