Load and Utilize New Abstract Classes

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:04
    Our goal is to make ShipLoader load things
  • 0:07
    from the database or from a JSON file.
  • 0:10
    In the resources directory, I've already created
  • 0:12
    a JsonFileShipStorage class.
  • 0:15
    Copy that into the service directory,
  • 0:18
    and let's take a look inside of here.
  • 0:20
    It has all of the same methods as PdoShipStorage,
  • 0:24
    except that this loads from a Jsonfile
  • 0:27
    instead of querying from a database.
  • 0:29
    Let's try and use this in our project.
Loading ...

Load and Utilize New Abstract Classes

Loading...

Now that we have created new abstract classes, we need to load and utilize them in our code. In this tutorial, I will show you how we can refactor our code to make use of our new abstract data loading classes.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.