Goals
- Mastering the fundamentals of object-oriented programming in PHP
-Mastering exceptions and PDO
Program
PHP reminders Understand
object-oriented, link design and programming
Understand the progressive appearance of the object in PHP over the versions
Structuring processing through objects
Create web scenarios via an organization of objects
Definition: object, instance and class
Grouping processes: classes and methods
Passing parameters and returning: the “hinting type”
Sharing data between methods: attributes, notion of encapsulation
Instantiating and calling on objects
Visibility of members : methods, attributes and constants
Static accesses
Implement the scenarios via classes and test them
Association: principle and notion of dependency
Handling one object via another: aggregation
Controlling the life cycle of an object via composition
Namespaces: namespaces
Automatically load definitions: autoload
Link objects together, define levels of abstraction
Make a contract via the interface declaration
Extend the behavior of an object by inheritance
Factor behaviors through a parent class
Factor behaviors through a trait
Block instantiation using abstract classes
Understand the notions of polymorphism and genericity
I nteraction between classes, management cardinality
PHP command line CLI
Installation of composer
Project
declaration Declaration of dependencies, version constraints
Dependencies related to the platform
Update and installation of dependencies
Auto-loading of definitions (PSR-0, PSR-4, classmap, files )
Debugging incompatibilities (why, why-not)
Declare your project with composer, import a library
Errors in PHP: Description of an error, levels
Error logging (log)
Customize the error handler
Exceptions: definition, common exceptions
Capturing and handling an exception
Throwing an exception
Define the particular cases to be managed via exceptions, set up the treatments
Structure of PDO classes
Connection to the data server, drivers and dsn
Perform simple queries
Retrieve data in a loop
Define the format of the result (table, column, object, class)
Retrieve the identifier of an insertion
Prepare queries and use them with parameters
Avoid SQL injections
Bind the parameter or directly the data
The cases of the LIKE and IN clauses
Transaction
management Error management
Set up multiple read and write processes in the database
Passing of the certification (if foreseen in the financing).
Duration
5 days
Price
£ 1958
Audience
PHP Developer or Modern Language Developer (Java, C #) with a good knowledge of PHP syntax
Prerequisites
Good knowledge of PHP
Reference
PHP1057-F
Sessions
Contact us for more informations about session date