Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2020-12-30 (1 month ago) | | Not yet rated by the users | | Total: 75 This week: 2 | | All time: 9,705 This week: 177 |
|
Description | | Author |
This class can show how to access all the class constructor parameters.
It is an example class with a constructor function that takes all its parameter values and store them in an array class variable.
Another class function can return the array with all the parameter values that were previously passed to the class constructor function. Innovation Award
December 2020
Number 3 |
PHP classes can have constructor functions that are called once a class object is created.
Like other types of functions, constructor functions can have a variable number of parameters.
This class demonstrates how to handle class constructor function calls by storing all the parameters in a way that they can be accessed later, regardless of the number of the parameters that were passed.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 5x
Winner: 2x |
|
Details
speciala-rguments
Je?eli nie wiemy ile parametrów b?dziemy przekazywa? do konstruktora
mo?emy zrobi? to w ten sposób.
Nie musimy ingerowa? w sam? klas? za ka?dym razem kiedy dopisujemy
kolejny parametr.
Za?ó?my ?e mamy samochód w którym nie wiemy ile osób b?dzie podró?owa?,
a chcemy przekaza? do konstruktora, za ka?dym razem inn? ilo?? osób.
Czy mo?emy o zawartych w klasie regu?ach powiedzie?, ?e jest nowym wzorcem
projektowym Special Arguments.
Prze?lijcie wasze opinie na email <ber34@o2.pl>
If you do not know how many parameters we pass to the constructor,
we can do it this way.
We do not need to interfere in the same class each time when
we add another parameter.
Suppose that we have a car that does not know how many people will travel
and we want to pass to the constructor, each time a different number of people.
Are we about contained in the class rules say that it is a new design
pattern Special Arguments.
Please send your feedback by email <ber34@o2.pl>
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.