| 1 | <?php |
||
| 11 | class SearchSource extends ParameterArrayConstructor |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Human-readable name |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | private $name; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * URL to source home page |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | private $url; |
||
| 24 | |||
| 25 | private $icon; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Construct a SearchSource from a search domain |
||
| 29 | * |
||
| 30 | * @param AbstractSearchDomain $domain |
||
| 31 | */ |
||
| 32 | public function __construct(AbstractSearchDomain $domain) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Human-readable name of the source search domain |
||
| 41 | * |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | public function getName() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * URL of the source search domain's home page |
||
| 51 | * |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function getUrl() |
||
| 58 | |||
| 59 | public function getIcon() |
||
| 63 | } |
||
| 64 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: