Randy_Johnson
4 months ago
550
3
General

Prevent Cascading Parameteres (OOP Solution needed)

Posted 4 months ago by Randy_Johnson

From my View I am directed to a Utilities Class which updates the address. The only problem is, is that I have two separate pages, sending different variables. So I have had to create it in such away that it goes as such.

+-------------+
|             |
|    VIEW     |
|             |
+------+------+
       |
       v
+------+----------+
|                 |
|    Utilities    | CLASS
|                 |
+------+----------+
       |
       v
+------+----------------------------------+
|                                         |
|    Update Address (Request $request)    | METHOD
|                                         |
|                                         |
|    method x ($request)                  |
|    method y ($request)                  |
|                                         |
+--------------------+--------------+-----+
                     |              |
                     v              v
+--------------------+------+  +----+--------------------+
|                           |  |                         |
|    method x ($request)    |  |   method y ($request)   |  METHODS
|                           |  |                         |
+---------------------------+  +-------------------------+

How do I stop the cascade of the $request. There must be a simpler and tidier way of doing this.

Please sign in or create an account to participate in this conversation.