I have an Oracle package that I need to access in CakePHP. I am trying to determine the best way to implement the code for calling this function. I need to pass for variables from the UI to the procedure being called. I want to be able to use the model for the field validation before submitting to the package. It is a very specific procedure call:
begin SCHEMA.package.function_name(vars); end;
At the same time, there isn’t the standard $this->save() or $this->find() to a package.
Does anyone have CakePHP experience with this? Or any suggestions for implementation? Should I just put it in a model by itself?
Well, after no response I did some digging this week, and I think I have a great solution to this. I was actually thinking it was more complicated than what it really is.
Set up a model to point to the package you create. Within the package there may be multiple functions. So the model will contain all of the functions for the package that are required for your application.
Here is what my model looks like:
Replace the {PACKAGENAME} with the name of the Oracle package. The rest should be self explanatory. You can also configure the function to handle variables, of course.