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,

  1. data found without error
  2. no data found without error
  3. 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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -