What is the best way of handling return in CakePhp Models? -
i'm researching coding standards cakephp 2.8 project. i'm looking way of handling return values in models.
for example in model want return data queried database. want say, "hey found data want , here is" or "sorry couldn't find anything" or "i encountered error while looking data want"
so there 3 types of return,
- data found without error
- no data found without error
- an error has occured while looking data
any appriciated.
why need that? built in
a) $data contains data
b) empty array (no data found obviously)
c) exception being thrown, can either catch or not.
so problem doesnt exist in first place imo :)
Comments
Post a Comment