TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-21-2009, 04:16 PM   #1 (permalink)
The Wanderer
 
Join Date: Jul 2009
Posts: 5
Thanks: 0
sohdubom is on a distinguished road
Default Class-Object visibility through Properties-Methods Access Modifiers

::Class-Object visibility through Properties-Methods Access Modifiers

In PHP, is it correct to say that we control Class-Object visibility by setting the correct Access Modifier to its properties and methods? eg. In PHP, classes are public, we can't declare a private nor protect class (we can use final and abstract, for other purposes)

Thanx in advance
sohdubom is offline  
Reply With Quote
Old 08-21-2009, 04:28 PM   #2 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

I don't really understand what you are saying ... but

A class has optional definitions that are final or abstract that specify specific functionality
Read more about this at http://us3.php.net/manual/en/language.oop5.basic.php

Properties and methods defined in a class wither it is public, private or protected have no influence on visibility of the class itself you can read more about this at
http://us3.php.net/manual/en/languag...visibility.php
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
Old 08-21-2009, 05:19 PM   #3 (permalink)
The Wanderer
 
Join Date: Jul 2009
Posts: 5
Thanks: 0
sohdubom is on a distinguished road
Default

Quote:
Originally Posted by ioan1k View Post
I don't really understand what you are saying ...
I'm talking about Encapsulation and Data Hiding, where Encapsulation is the ability to group attributes and methods inside a single class/object and Data Hiding is the ability to access control to class data(attributes) and methods from external users(other objects) ... as rule of thumb, access to class/objects functionalities should be done through its public interfaces, aka public methods ... attributes should all be private/protected for good Data Hiding to work ... obs. class's public interfaces not to be confused to the class construct named <<Interface>>

I'm new to PHP, but not to OO so I'm checking to see if my post regarding Encapsulation and Data Hiding in PHP was right ... I think so ... according to 'Enfernikus' last post
sohdubom is offline  
Reply With Quote
Old 08-21-2009, 04:33 PM   #4 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

Yes this is correct, we can not scope an object in PHP as we don't have Namespaces till PHP6. ( Correct me if I'm wrong )
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 08-21-2009, 05:40 PM   #5 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Enfernikus View Post
… we don't have Namespaces till PHP6. ( Correct me if I'm wrong )
Namespaces came with 5.3
Salathe is offline  
Reply With Quote
Old 08-21-2009, 05:44 PM   #6 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

Really!? I'm going to go have some fun now...
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 08-21-2009, 06:11 PM   #7 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Enfernikus View Post
Really!? I'm going to go have some fun now...
Really! Now I can use TalkPHP\Members\Efernikus as Slave;
Salathe is offline  
Reply With Quote
Old 08-21-2009, 06:23 PM   #8 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
Really! Now I can use TalkPHP\Members\Efernikus as Slave;
Touché! We'll have a Gladiator type going of things I suspect.

( Movie - Russel Crowe )
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstract Classes sketchMedia Advanced PHP Programming 18 02-28-2013 05:38 AM
Using the factory pattern (mad rantings of a mind without coffee) sketchMedia Advanced PHP Programming 35 09-25-2009 11:05 AM
[wip][Article] Multi-tiered programming and how it ties to OOP Village Idiot Tips & Tricks 9 07-31-2009 07:25 PM
Extends? Implements? Private, Public, Protected? Aaron Advanced PHP Programming 13 05-07-2008 02:38 AM
PHP5 Classes A to Z Part 1 quantumkangaroo Advanced PHP Programming 11 04-01-2008 04:21 AM


All times are GMT. The time now is 09:27 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design