-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Is it possible to implement __call of a magic method to easily call similar methods?
For example: Now I have to describe each method
final class MainPageDTO extends SimpleDTO
{
protected string $promoTitle;
protected string $educationTitle;
protected string $activityTitle;
public function getPromoTitle(): string
{
return $this->promoTitle;
}
public function getEducationTitle(): string
{
return $this->educationTitle;
}
public function getActivityTitle(): string
{
return $this->activityTitle;
}
}But I would like to describe the property once and then refer to it
final class MainPageDTO extends SimpleDTO
{
protected string $promoTitle;
protected string $educationTitle;
protected string $activityTitle;
}
$mainPageDto->getActivityTitle();
$mainPageDto->getEducationTitle();
$mainPageDto->getPromoTitle();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels