Module Development

Create a Basic PHP Class for Drupal 8, 9

Sprout Video

This PHP tutorial covers the basics of classes and objects. You'll learn how to set up a class and then what a class is and what objects are like. By the end of this tutorial you should be able to create a class, an object, create a property, and set the value of a property inside a class.

Additional resources

The Basics: class (PHP Manual)