Answer the question
In order to leave comments, you need to log in
How to build a chain of calls to a static function?
Hello! I don’t understand how correctly (and is it possible?) to build a chain of calls for static class functions?
For example,
USER::take('email')->where(['id' => 1]); // Или что-то подобное.
Answer the question
In order to leave comments, you need to log in
get_header();
seriously? you can't write like this anymore
<?php you need
there is no difference if the method is static or not: if it returns an object, then it can be chained.
the most primitive example is ideone.com/Nr4MgL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question