I get the following error running PHP 5.3.13 and I cannot see why.
Declaration of CustomCourse::toArray() should be compatible with that of BaseCourse::toArray()
This is my PHP code below, although cut down to the important stuff to keep the post length to only what is needed.
I should also add that the Course
class exposes no toArray
method.
I see other similar threads on SO, but none appear to offer me a solution.
/**
* this is the CHILD class
*/
class CustomCourse extends BaseCourse {
public function toArray() {
$values = parent::toArray();
// do some more with $values here
return $values;
}
}
/**
* this is the PARENT class
*/
class BaseContact extends Course {
public function toArray($platform = GOLF_PLATFORM) {
$values = array();
$values['user_id'] = $this->getUserId();
// do some more in here
return $values;
}
}