Namespaces and Core PHP Classes

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

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

Log in Sign up
  • 0:08
    Let’s close all our tabs and open up Container.
  • 0:14
    In the last course, we created 2 different ways to load ship objects.
  • 0:19
    1 that reads a JSON file, JsonFileShipStorage and another that reads from a database, PdoShipStorage.
  • 0:27
    And you could switch back and forth between these without breaking anything
  • 0:31
    thanks to our cool ShipStorageInterface.
  • 0:34
    Change it to use the PDO version and refresh.
  • 0:39
    Whoa, new error. Class 'Service\PDO\ not found on Container.php line 28.
  • 0:47
    Let’s check that out.
  • 0:51
    Here we see the exact same error as before: Undefined class PDO.
  • 0:56
    So far, the answer to this has always been,
Loading ...

Namespaces and Core PHP Classes


In this PHP tutorial we'll continue our look at namespaces and how they work in PHP applications.

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.