N
N
Nikolay2017-05-04 14:00:30
CMS
Nikolay, 2017-05-04 14:00:30

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

3 answer(s)
D
Dmitry, 2018-06-19
@Magnetx

<? get_header();?>
seriously? you can't write like this anymore
<?php you need

D
DevMan, 2017-05-04
@iNickolay

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

D
DTX, 2017-05-04
@DirecTwiX

stackoverflow.com/questions/125268/chaining-static...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question