Welcome Guest, Not a member yet? Register   Sign In
Where does the getRecent() method originate from?
#11

(08-09-2023, 06:10 PM)kenjis Wrote:
(08-09-2023, 06:01 PM)sammyskills Wrote: Oh, I get you. For that to work, the method will need to be added to the system/Model's class phpdoc @method keyword.
WDYT @kenjis ?

Yes, if a Query Builder method returns $this and the method can be used in Models without problems,
we can add to the system/Model's class phpdoc @method keyword.
Adding it is fine by me.

Both the when() and whenNot() methods are conditional traits and they return $this. Also, they work well in models without any problems.

Just a question, since they are not new methods, is there any need for tests for this purpose?
Reply
#12

I think it is better to have tests for Model and when()/whenNot().
Reply
#13

I've submitted a PR https://github.com/codeigniter4/CodeIgniter4/pull/7836
Reply




Theme © iAndrew 2016 - Forum software by © MyBB