How to define method chaining in PHP -


संभव डुप्लिकेट:

मैं संयुक्त कार्यों का उपयोग करना चाहता हूं, जैसे:

  चुनें ("उपयोगकर्ताओं से चुनें")। जहां ("उपयोगकर्ता = l0") .जोड़ें ("।");   

यह कैसे php में परिभाषित है?

  फ़ंक्शन का चयन करें () {.... नई myType पर लौटें; } वर्ग myType {function where () {... $ $ लौटाता है; } फ़ंक्शन शामिल () {... $ $ लौटाता है; }}   

डेमो:

- & gt; के बजाय PHP में उपयोग करना याद रखें।

यह PHP फ़ंक्शन चेनिंग का एक उदाहरण है।

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -