See the objects below:
interface IMedia
{
public function getThemed();
public function getDownloadLink();
}
class Video implements IMedia
{
public function getThemed() {}
public function getDownloadLink() {}
}
If there are some common attributes such as:
public $size;
public $uploadedDate;
public $hitCounts;
Can they be added to IMedia? Or is it recommended to use abstract class in that place?
@Muneer
First of all it’s not possible. Interface doesn’t allow this. I’d suggest to do something like this: