Thread: uhh... OOP?
View Single Post
Old 01-23-2008, 06:23 AM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

An Object in PHP is $this->object
$this grabs the property reference for that method.
And a method I think only referes to functions inside a class..
And such methods as Magic methods are called such as:
PHP Code:
function __construct();
function 
__destruct();
function 
__get();
function 
__set();
function 
__autoload();
function 
__isset();
function 
__unset(); 
And are only acceptable in PHP5, thus I love it!

More information on Magic Methods, Classes, Objects:
PHP: Classes and Objects (PHP 5) - Manual

Properties are things as those variables inside the class:
PHP Code:
class test
{
 public 
$test;
 public 
$foo;
 public 
$orc;

PHP4 had Var though it's still capable, it's more reasonably acceptable to use visibility: Public, Private, Protected

I usually use __construct and then add upon inside my functions, though you can only set your visibility on __construct, cause in my theory, it's making every single thing in that construct as the visibility:
PHP Code:
 public function __construct()
 {
   function 
yourfunction()
   {
     
// add whatever
   
}
 } 
[/php]


PHP Code:
$object = new object
This means you're assigning $object to get a new instance of object class, thus theres no parentheses.

Also, an object can infact be an array.


As said, above, to the link about PHP5 classes, objects, I'd study that and continue on with whatever you're doing! :]

I could go on forever, but just check the link, considering I don't want to make duplicate posts. :P
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
The Following 2 Users Say Thank You to Orc For This Useful Post:
Aaron (01-23-2008), obolus (01-23-2008)