1 00:00:00,410 --> 00:00:01,560 Hi. 2 00:00:01,560 --> 00:00:06,400 I'm Alena, and 3 00:00:06,400 --> 00:00:10,240 today I'm going to introduce you to object oriented programming in PHP. 4 00:00:11,510 --> 00:00:14,290 PHP is a procedural language at its heart. 5 00:00:14,290 --> 00:00:16,400 In our previous PHP courses, 6 00:00:16,400 --> 00:00:21,160 we've mostly used procedural code in our projects In procedural programming 7 00:00:21,160 --> 00:00:26,390 you specify a set of ordered steps needed to implement the requested functionality. 8 00:00:26,390 --> 00:00:28,600 This can make our program easy to read, 9 00:00:28,600 --> 00:00:31,800 because we can just walk through it step by step. 10 00:00:31,800 --> 00:00:35,690 However, as our code base grows, can become harder and 11 00:00:35,690 --> 00:00:39,770 harder to remember everything we just read, and how it all fits together. 12 00:00:41,300 --> 00:00:43,210 Organizing our code can help. 13 00:00:43,210 --> 00:00:45,970 We can group code that's used multiple times 14 00:00:45,970 --> 00:00:49,600 into a function that can be referenced throughout the program. 15 00:00:49,600 --> 00:00:52,810 We can also group our functions into a single file so 16 00:00:52,810 --> 00:00:54,800 that we know where to find them. 17 00:00:54,800 --> 00:00:59,430 In addition, we can group functions into separate files that are organized 18 00:00:59,430 --> 00:01:01,140 based on the functionality. 19 00:01:01,140 --> 00:01:06,400 For example, we could group all functions that deal with math into one file. 20 00:01:06,400 --> 00:01:09,485 And all functions that deal with products into another file. 21 00:01:09,485 --> 00:01:14,180 Object-oriented programming gives us an even more powerful way 22 00:01:14,180 --> 00:01:15,205 to organize our code. 23 00:01:15,205 --> 00:01:20,260 Object-oriented programming lets us group data, as well as functions, 24 00:01:20,260 --> 00:01:23,060 into a specific topic or piece of functionality. 25 00:01:24,590 --> 00:01:28,320 If you've completed our PHP courses on building a basic website, 26 00:01:28,320 --> 00:01:30,630 you've already been using objects. 27 00:01:30,630 --> 00:01:33,510 This course will help you more fully understand 28 00:01:33,510 --> 00:01:37,730 the concepts involved in object oriented programming and 29 00:01:37,730 --> 00:01:40,380 give you the skills you need to create your own objects. 30 00:01:41,460 --> 00:01:46,540 Although the terms object and class often appear to be used interchangeably, 31 00:01:46,540 --> 00:01:48,360 they are not the same thing. 32 00:01:48,360 --> 00:01:51,100 A class is like this instruction booklet. 33 00:01:51,100 --> 00:01:53,970 It tells us which pieces to use, and how to put them together. 34 00:01:55,020 --> 00:01:57,330 The object is like this finished piece. 35 00:01:58,740 --> 00:02:01,960 To give you a clear understanding of how to use objects and 36 00:02:01,960 --> 00:02:05,810 classes, we'll be creating a cookbook full of recipes. 37 00:02:05,810 --> 00:02:07,180 Let's review the finished project. 38 00:02:08,590 --> 00:02:12,280 We'll create a cookbook collection full of recipe objects, 39 00:02:12,280 --> 00:02:16,070 from there we'll be able to perform some actions. 40 00:02:16,070 --> 00:02:18,389 We can display the recipe titles from our cookbook. 41 00:02:22,640 --> 00:02:24,700 We can display a shopping list of ingredients. 42 00:02:28,680 --> 00:02:31,100 Or we can display an individual recipe. 43 00:02:36,859 --> 00:02:42,180 By the end of this course you'll be able to structure and utilize your own objects. 44 00:02:42,180 --> 00:02:45,910 After that, you'll be ready to launch into more detailed explanations 45 00:02:45,910 --> 00:02:50,920 o the terminology and concepts surrounding object-oriented programming. 46 00:02:50,920 --> 00:02:53,520 Once you dive into the concepts and terminology, 47 00:02:53,520 --> 00:02:57,160 you'll really start to understand the power of object-oriented programming. 48 00:02:58,630 --> 00:03:02,705 If at any time we hit a particular area where you're struggling to follow along. 49 00:03:02,705 --> 00:03:08,540 Remember,you can always slow down or speed up the playback of these videos. 50 00:03:08,540 --> 00:03:11,710 I also include more information in the teacher's notes. 51 00:03:11,710 --> 00:03:14,420 So don't forget to check those out as well. 52 00:03:14,420 --> 00:03:18,080 And finally, we have an awesome community of fellow students 53 00:03:18,080 --> 00:03:20,670 who can help you through a difficult section. 54 00:03:20,670 --> 00:03:23,490 Sometimes it just takes another perspective and 55 00:03:23,490 --> 00:03:27,240 I'll be here to guide you through each step of the way, so let's keep going.