Php Encapsulation (Object Oriented Php 2021)

preview_player
Показать описание
Php Encapsulation ~ Object Oriented Php 2020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Encapsulation allows a class to define what behavior & properties the external world is able to access within a class or objects.

There are three modifiers AKA assessors that define how a class encapsulates its self from the perspective of the outside world.

The first accessor is public. The outside world is able to access public properties and public functions.

The second accessor is protected. Protected Properties and functions with a protected modifier are only accessible internally. Child classes inherit protected properties.

The third accessor is private. Private properties are only accessible internally and are NOT inherited by child classes.

1. Public ~ Anything with access to the object can use the property or function

2. Protected ~ Any internal functions can access the property or function and the protected property will be inherited by child classes.

3. Private ~ Only the class itself can access the property or function, private properties or functions will NOT be inherited by children.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Clean Code Studio ~ Simplify!
Clean Code Clean Life
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#PhpEncapsulation #ObjectOrientedPhp #PhpModifiers

Рекомендации по теме
Комментарии
Автор

thank you man. amazing work! i'm learning a lot!

ChrisOkw
Автор

Great object oriented Php series, thanks Zach!

samualobryan
Автор

I really love your OOP. Great series you help me a lot.

paul.stream
Автор

Omg you explain it so good man, def like

ridddlewrong
Автор

Good one. Hope we have more PHP goodies in a series lesson(s).

goodwish